zork2Class
Class Game

java.lang.Object
  |
  +--zork2Class.Game

public class Game
extends java.lang.Object

the class Game creation :5 mai 03 at 17:53:31

Version:
1.0
Author:
Michel de VERDELHAN

Constructor Summary
Game()
          the constructor for game
 
Method Summary
 void changeIsLocked()
          void Game::changeIsLocked
change the ihm status : now we can run an other frame
 void executeCommand(java.lang.String com)
          method :void executeCommand
this method permit to manage the commandWord executeur
this method ignore the word case
the known commands are :
best score : launch the best score frame
help : launch the help frame
hide all : hide all the dialog frame
exit : ask if player realy want to quit and exit if true
exit -f : ewit program without asking
cheat : enable cheat mode : player name is changed to "tricheur"
life : player life number = 6
god : player capacity are all at 100 and player have the ultimate weapon
go north : player move to the north, if there is an open door he change room
go south : like go north but for south
go East : like go north but for east
go west : like go north but for west
take : if there is an item in the accessible comboBox the player take it
drop : drop the inventory selected item an floor
open chest : if the player have the chest key, this command open the chest
open door : if the player have the door key, this command open the door
weapon : the inventory selected is set as current weapon. if the selected item is already the weapon, the player's current weapon is set as null
noweapon : player's current weapon is set as null
description : launch the item description frame
clear : clear the consol
kill : remove 10 player's energy points
high score : launch the high score frame
save : save the current game. if there is no name given, the save name is the default name.
 java.lang.String getDungeonName()
           
 GameFrame getFenetre()
          Returns the game window.
 javax.swing.JDialog getFenetreLoading()
          method :JDialog getFenetreLoading
 Room getFinalRoom()
          Returns the finalRoom.
 Room getFirstRoom()
          Returns the firstRoom.
 java.util.Hashtable getListRoom()
          Returns the listItem.
 Player getPlayer()
          Returns the player.
 boolean isDeveloppeur()
          Returns the isDeveloppeur.
 boolean isLockCommand()
          get the lockCommand parameter
 void launchCreatPerso()
          void Game::launchCreatPerso
create or show if already created the create perso frame
 void launchGame()
          void Game::launchGame
create or show if already created the main game frame
 void launchLoadGameGame()
          void Game::launchLoadGame
create or show if already created the load game frame for game frame
 void launchLoadGameMenu()
          void Game::launchLoadGameGame
create or show if already created the load game frame for main menu frame
 void launchMainMenu()
          void Game::launchMainMenu
create or show if already created the main Menu
 void launchSaveGame()
          void Game::launchSaveGame
create or show if already created the save ame frame
 void loadDungeonFromFile(java.lang.String dungeon)
          method :void loadDungeonFromFile
load a dungeon from a file
 void PlayerIsDead()
          method :void PlayerIsDead
method called when the player's life number if 0 so the player have lose
 void PlayerWin()
          method :void PlayerWin
method called when the player is in the final room so the player have win
 void setDungeonName(java.lang.String string)
          set the dungeon name
 void setFenetre(GameFrame fenetre)
          Sets the game window.
 void setFenetreLoading(javax.swing.JDialog dialog)
          method :void setFenetreLoading
 void setFinalRoom(Room finalRoom)
          Sets the finalRoom.
 void setFirstRoom(Room firstRoom)
          Sets the firstRoom.
 void setIsDeveloppeur(boolean isDeveloppeur)
          Sets if the player is a developpeur.
 void setListRoom(java.util.Hashtable listRoom)
          Sets the listItem.
 void setLockCommand(boolean b)
          set the lockCommand parameter
lockCommand is used to stop the execution of the command, only text command ( # ) are read.
 void setPlayer(Player player)
          Sets the player.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Game

public Game()
the constructor for game

Method Detail

executeCommand

public void executeCommand(java.lang.String com)
method :void executeCommand
this method permit to manage the commandWord executeur
this method ignore the word case
the known commands are :
  1. best score : launch the best score frame
  2. help : launch the help frame
  3. hide all : hide all the dialog frame
  4. exit : ask if player realy want to quit and exit if true
  5. exit -f : ewit program without asking
  6. cheat : enable cheat mode : player name is changed to "tricheur"
  7. life : player life number = 6
  8. god : player capacity are all at 100 and player have the ultimate weapon
  9. go north : player move to the north, if there is an open door he change room
  10. go south : like go north but for south
  11. go East : like go north but for east
  12. go west : like go north but for west
  13. take : if there is an item in the accessible comboBox the player take it
  14. drop : drop the inventory selected item an floor
  15. open chest : if the player have the chest key, this command open the chest
  16. open door : if the player have the door key, this command open the door
  17. weapon : the inventory selected is set as current weapon. if the selected item is already the weapon, the player's current weapon is set as null
  18. noweapon : player's current weapon is set as null
  19. description : launch the item description frame
  20. clear : clear the consol
  21. kill : remove 10 player's energy points
  22. high score : launch the high score frame
  23. save : save the current game. if there is no name given, the save name is the default name. Elsewhere the save name is the given name
  24. load : load a game. if the load name is not given, this try to load the default name. Elsewhere the load name is the given name (warrning : name must be given without the .sz2 extention)
  25. # : only write the text write after the # without trying to execute it

Parameters:
com - the command to execute

loadDungeonFromFile

public void loadDungeonFromFile(java.lang.String dungeon)
method :void loadDungeonFromFile
load a dungeon from a file


PlayerIsDead

public void PlayerIsDead()
method :void PlayerIsDead
method called when the player's life number if 0 so the player have lose


PlayerWin

public void PlayerWin()
method :void PlayerWin
method called when the player is in the final room so the player have win


launchMainMenu

public void launchMainMenu()
void Game::launchMainMenu
create or show if already created the main Menu


launchCreatPerso

public void launchCreatPerso()
void Game::launchCreatPerso
create or show if already created the create perso frame


launchSaveGame

public void launchSaveGame()
void Game::launchSaveGame
create or show if already created the save ame frame


launchLoadGameGame

public void launchLoadGameGame()
void Game::launchLoadGame
create or show if already created the load game frame for game frame


launchLoadGameMenu

public void launchLoadGameMenu()
void Game::launchLoadGameGame
create or show if already created the load game frame for main menu frame


launchGame

public void launchGame()
void Game::launchGame
create or show if already created the main game frame


changeIsLocked

public void changeIsLocked()
void Game::changeIsLocked
change the ihm status : now we can run an other frame


getFinalRoom

public Room getFinalRoom()
Returns the finalRoom.

Returns:
Room

getFirstRoom

public Room getFirstRoom()
Returns the firstRoom.

Returns:
Room

getListRoom

public java.util.Hashtable getListRoom()
Returns the listItem.

Returns:
Hashtable

getPlayer

public Player getPlayer()
Returns the player.

Returns:
Player

setFinalRoom

public void setFinalRoom(Room finalRoom)
Sets the finalRoom.

Parameters:
finalRoom - The finalRoom to set

setFirstRoom

public void setFirstRoom(Room firstRoom)
Sets the firstRoom.

Parameters:
firstRoom - The firstRoom to set

setListRoom

public void setListRoom(java.util.Hashtable listRoom)
Sets the listItem.


setPlayer

public void setPlayer(Player player)
Sets the player.

Parameters:
player - The player to set

isDeveloppeur

public boolean isDeveloppeur()
Returns the isDeveloppeur.

Returns:
boolean

setIsDeveloppeur

public void setIsDeveloppeur(boolean isDeveloppeur)
Sets if the player is a developpeur.

Parameters:
isDeveloppeur - The isDeveloppeur to set

getFenetre

public GameFrame getFenetre()
Returns the game window.

Returns:
GameFrame

setFenetre

public void setFenetre(GameFrame fenetre)
Sets the game window.

Parameters:
fenetre - The fenetre to set

isLockCommand

public boolean isLockCommand()
get the lockCommand parameter

Returns:
the lockCommand value

setLockCommand

public void setLockCommand(boolean b)
set the lockCommand parameter
lockCommand is used to stop the execution of the command, only text command ( # ) are read.

Parameters:
b -

getFenetreLoading

public javax.swing.JDialog getFenetreLoading()
method :JDialog getFenetreLoading

Returns:
the loading pop up window

setFenetreLoading

public void setFenetreLoading(javax.swing.JDialog dialog)
method :void setFenetreLoading

Parameters:
dialog -

getDungeonName

public java.lang.String getDungeonName()
Returns:
the dungeon name

setDungeonName

public void setDungeonName(java.lang.String string)
set the dungeon name

Parameters:
string - the dungeon name to set