|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--VASSAL.command.Command
Command is an abstract class that does something. Any action that
takes place during a game should be encapsulated in a Command
object. When performing actions during a game, corresponding
Commands will be logged in the current logfile and/or sent to other
players on the server.
Commands can be strung together into compound commands with the
append(VASSAL.command.Command) method.
CommandEncoder| Constructor Summary | |
Command()
|
|
| Method Summary | |
Command |
append(Command c)
Append a subcommand to this Command. |
void |
execute()
Execute this command by first invoking executeCommand(),
then invoking execute() recursively on all subcommands. |
protected abstract void |
executeCommand()
Perform the action which this Command represents |
Command[] |
getSubCommands()
|
Command |
getUndoCommand()
|
protected boolean |
hasNullSubcommands()
|
boolean |
isLoggable()
|
boolean |
isNull()
|
protected abstract Command |
myUndoCommand()
If the action can be undone, return a Command that performs the inverse action. |
void |
stripSubCommands()
Remove all subcommands. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Command()
| Method Detail |
public Command[] getSubCommands()
public void execute()
executeCommand(),
then invoking execute() recursively on all subcommands.
protected abstract void executeCommand()
protected abstract Command myUndoCommand()
executeCommand(), not the actions of subcommands
public void stripSubCommands()
public boolean isNull()
public boolean isLoggable()
protected boolean hasNullSubcommands()
public java.lang.String toString()
toString in class java.lang.Objectpublic Command append(Command c)
public Command getUndoCommand()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||