VASSAL.command
Class RemovePiece

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

public class RemovePiece
extends Command

This Command removed a GamePiece from a game. Its undo Command is AddPiece.


Constructor Summary
RemovePiece(GamePiece p)
           
RemovePiece(java.lang.String id)
           
 
Method Summary
protected  void executeCommand()
          Removes a piece by invoking Map.removePiece(VASSAL.counters.GamePiece) if the piece belongs to a Map, followed by GameState#removePiece.
 java.lang.String getId()
           
 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

RemovePiece

public RemovePiece(GamePiece p)

RemovePiece

public RemovePiece(java.lang.String id)
Method Detail

executeCommand

protected void executeCommand()
Removes a piece by invoking Map.removePiece(VASSAL.counters.GamePiece) if the piece belongs to a Map, followed by GameState#removePiece.

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()

getId

public java.lang.String getId()