Package VASSAL.command
Class ChangePiece
java.lang.Object
VASSAL.command.Command
VASSAL.command.ChangePiece
This Command changes the state of a
GamePiece. Its undo
Command is another ChangePiece with the new and old states
reversed.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAppend a subcommand to this Command.protected voidChanges the state of aGamePieceby invokingGamePiece.setState(java.lang.String)Detailed information for toString()getId()booleanisNull()protected CommandIf the action can be undone, return a Command that performs the inverse action.Methods inherited from class VASSAL.command.Command
execute, getSubCommands, getUndoCommand, isAtomic, isLoggable, isNullOrContainsOnly, stripSubCommands, toString
-
Field Details
-
newState
-
oldState
-
-
Constructor Details
-
ChangePiece
- Parameters:
id- the id of theGamePieceto changeoldState- the previous state of the piecenewState- the new state of the piece
-
-
Method Details
-
executeCommand
protected void executeCommand()Changes the state of aGamePieceby invokingGamePiece.setState(java.lang.String)- Specified by:
executeCommandin classCommand
-
append
Description copied from class:CommandAppend a subcommand to this Command. -
myUndoCommand
Description copied from class:CommandIf the action can be undone, return a Command that performs the inverse action. The Command returned should only undoCommand.executeCommand(), not the actions of subcommands- Specified by:
myUndoCommandin classCommand
-
getId
-
getNewState
-
getOldState
-
isNull
public boolean isNull() -
getDetails
Description copied from class:CommandDetailed information for toString()- Overrides:
getDetailsin classCommand
-