de.adom.jade.ui.commands
Class Command

java.lang.Object
  extended by de.adom.jade.ui.commands.Command
Direct Known Subclasses:
RepeatingCommand

public abstract class Command
extends java.lang.Object

The list of commands for the game. Some triv


Field Summary
static Command E
          The "move east" command.
static Command ENTER_LOCATION
          Enters a location on the map.
static Command N
          The "move north" command.
static Command NE
          The "move north east" command.
static Command NW
          The "move north west" command.
static Command S
          The "move south" command.
static Command SE
          The "move south east" command.
static Command SW
          The "move south west" command.
static Command W
          The "move west" command.
static Command WAIT
          The "wait" command.
static RepeatingCommand WALK_E
          The "walk east" command.
static RepeatingCommand WALK_N
          The "walk north" command.
static RepeatingCommand WALK_NE
          The "walk north east" command.
static RepeatingCommand WALK_NW
          The "walk north west" command.
static RepeatingCommand WALK_S
          The "walk south" command.
static RepeatingCommand WALK_SE
          The "walk south east" command.
static RepeatingCommand WALK_SW
          The "walk south west" command.
static RepeatingCommand WALK_W
          The "walk west" command.
static RepeatingCommand WALK_WAIT
          The "walk wait" command.
 
Constructor Summary
protected Command(java.lang.String name)
          Creates a new command object with a given logical name.
 
Method Summary
 boolean execute(Being being)
          Executes the command on a being.
protected abstract  boolean executeImpl(Being being)
          Executes the command on a being.
static Command getCommand(java.lang.String name)
          Returns the command object for a given logical name.
 java.lang.String toString()
          Returns the string representation of a given command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WAIT

public static final Command WAIT
The "wait" command. Causes the being to wait for one turn without doing anything.


N

public static final Command N
The "move north" command. Causes the being to move one step to the north.


NE

public static final Command NE
The "move north east" command. Causes the being to move one step to the north east.


E

public static final Command E
The "move east" command. Causes the being to move one step to the east.


SE

public static final Command SE
The "move south east" command. Causes the being to move one step to the south east.


S

public static final Command S
The "move south" command. Causes the being to move one step to the south.


SW

public static final Command SW
The "move south west" command. Causes the being to move one step to the south west.


W

public static final Command W
The "move west" command. Causes the being to move one step to the west.


NW

public static final Command NW
The "move north west" command. Causes the being to move one step to the north.


WALK_WAIT

public static final RepeatingCommand WALK_WAIT
The "walk wait" command. Causes the being to wait for one turn without doing anything.


WALK_N

public static final RepeatingCommand WALK_N
The "walk north" command. Causes the being to move one step to the north.


WALK_NE

public static final RepeatingCommand WALK_NE
The "walk north east" command. Causes the being to move one step to the north east.


WALK_E

public static final RepeatingCommand WALK_E
The "walk east" command. Causes the being to move one step to the east.


WALK_SE

public static final RepeatingCommand WALK_SE
The "walk south east" command. Causes the being to move one step to the south east.


WALK_S

public static final RepeatingCommand WALK_S
The "walk south" command. Causes the being to move one step to the south.


WALK_SW

public static final RepeatingCommand WALK_SW
The "walk south west" command. Causes the being to move one step to the south west.


WALK_W

public static final RepeatingCommand WALK_W
The "walk west" command. Causes the being to move one step to the west.


WALK_NW

public static final RepeatingCommand WALK_NW
The "walk north west" command. Causes the being to move one step to the north.


ENTER_LOCATION

public static final Command ENTER_LOCATION
Enters a location on the map.

Constructor Detail

Command

protected Command(java.lang.String name)
Creates a new command object with a given logical name.

Parameters:
name - the logical name for this command token
Method Detail

execute

public final boolean execute(Being being)
Executes the command on a being.

Parameters:
being - the being who will execute the command
Returns:
a value indicating whether the action is to be counted as a valid move

executeImpl

protected abstract boolean executeImpl(Being being)
Executes the command on a being.

Parameters:
being - the being who will execute the command
Returns:
a value indicating whether the action is to be counted as a valid move

toString

public java.lang.String toString()
Returns the string representation of a given command.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of a given command

getCommand

public static Command getCommand(java.lang.String name)
Returns the command object for a given logical name.

Parameters:
name - the logical name of the command object
Returns:
the command object referenced by the logical name or null if no such object exists