jurpe.system.commands
Class DungeonCommand

java.lang.Object
  extended by jurpe.system.commands.DungeonCommand

public class DungeonCommand
extends java.lang.Object

A dungeon command is a group of constants that represent a command issued in the dungeon. It encapsulate a "feedback" string to communicate to the user the results of the command and an "option" so that the command can have a parameter.


Field Summary
static int ATTACK_MONSTER
           
static int CLOSE_DOOR
           
static int DIG
           
static int ENTER
           
static int ENTER_DUNGEON
           
static int ENTER_INN
           
static int ENTER_SHOP
           
static int ENTER_TRAINER
           
static int MOVE
           
static int OPEN_DOOR
           
static int PICK_UP
           
static int STAIRS_DOWN
           
static int STAIRS_UP
           
static int UNKNOWN
           
 
Constructor Summary
DungeonCommand(int command)
          Constructor
DungeonCommand(int command, java.lang.String feedback)
          Constructor
 
Method Summary
 boolean equals(java.lang.Object o)
          Equality conditions
 int getCommand()
          Get command ID
 java.lang.String getFeedback()
          Get feedback of this command
 java.lang.String getOption()
          Get command option
 int hashCode()
          Direction hash code.
 void setFeedback(java.lang.String f)
          Set the feedback for when the user selects this command
 void setOption(java.lang.String o)
          Set an option for this command
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIG

public static final int DIG
See Also:
Constant Field Values

ENTER

public static final int ENTER
See Also:
Constant Field Values

ENTER_SHOP

public static final int ENTER_SHOP
See Also:
Constant Field Values

ENTER_INN

public static final int ENTER_INN
See Also:
Constant Field Values

ENTER_TRAINER

public static final int ENTER_TRAINER
See Also:
Constant Field Values

ENTER_DUNGEON

public static final int ENTER_DUNGEON
See Also:
Constant Field Values

MOVE

public static final int MOVE
See Also:
Constant Field Values

STAIRS_UP

public static final int STAIRS_UP
See Also:
Constant Field Values

STAIRS_DOWN

public static final int STAIRS_DOWN
See Also:
Constant Field Values

ATTACK_MONSTER

public static final int ATTACK_MONSTER
See Also:
Constant Field Values

OPEN_DOOR

public static final int OPEN_DOOR
See Also:
Constant Field Values

CLOSE_DOOR

public static final int CLOSE_DOOR
See Also:
Constant Field Values

PICK_UP

public static final int PICK_UP
See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
See Also:
Constant Field Values
Constructor Detail

DungeonCommand

public DungeonCommand(int command)
Constructor

Parameters:
command - CommandID (see static fields)

DungeonCommand

public DungeonCommand(int command,
                      java.lang.String feedback)
Constructor

Parameters:
command - CommandID (see static fields)
feedback - Feedback when the user selects this command
Method Detail

getCommand

public int getCommand()
Get command ID

Returns:
command ID

setFeedback

public void setFeedback(java.lang.String f)
Set the feedback for when the user selects this command

Parameters:
f - Feedback when the user selects this command

getFeedback

public java.lang.String getFeedback()
Get feedback of this command

Returns:
feedback of this command

setOption

public void setOption(java.lang.String o)
Set an option for this command

Parameters:
o - Option for this command (ie> monster to attack)

getOption

public java.lang.String getOption()
Get command option

Returns:
command option if present, else null

hashCode

public int hashCode()
Direction hash code.

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code

equals

public boolean equals(java.lang.Object o)
Equality conditions

Overrides:
equals in class java.lang.Object
Parameters:
o - Object to compare
Returns:
True if o is equal to this

Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net