VASSAL.command
Class AddPiece

java.lang.Object
  |
  +--VASSAL.command.Command
        |
        +--VASSAL.command.AddPiece

public class AddPiece
extends Command

This Command adds a GamePiece to a game. Its undo Command is RemovePiece.


Constructor Summary
AddPiece(GamePiece p)
           
AddPiece(GamePiece p, java.lang.String state)
           
 
Method Summary
protected  void executeCommand()
          Adds a piece by invoking GameState.addPiece(VASSAL.counters.GamePiece), followed by GamePiece.setState(java.lang.String)
 java.lang.String getState()
           
 GamePiece getTarget()
           
protected  Command myUndoCommand()
          If the action can be undone, return a Command that performs the inverse action.
 
Methods inherited from class VASSAL.command.Command
append, execute, getSubCommands, getUndoCommand, hasNullSubcommands, isLoggable, isNull, stripSubCommands, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AddPiece

public AddPiece(GamePiece p)

AddPiece

public AddPiece(GamePiece p,
                java.lang.String state)
Method Detail

executeCommand

protected void executeCommand()
Adds a piece by invoking GameState.addPiece(VASSAL.counters.GamePiece), followed by GamePiece.setState(java.lang.String)

Specified by:
executeCommand in class Command

myUndoCommand

protected Command myUndoCommand()
Description copied from class: Command
If the action can be undone, return a Command that performs the inverse action. The Command returned should only undo Command.executeCommand(), not the actions of subcommands

Specified by:
myUndoCommand in class Command

getTarget

public GamePiece getTarget()

getState

public java.lang.String getState()