vitro.grid
Class DestroyAction
java.lang.Object
vitro.grid.GridAction
vitro.grid.DestroyAction
- All Implemented Interfaces:
- Action
public class DestroyAction
- extends GridAction
A DestroyAction encapsulates the process of
removing one or more Actors from a Grid.
actors
public final Map<Actor,Location> actors
- A mapping from the destroyed Actors to their original Locations.
DestroyAction
public DestroyAction(Grid model,
Actor... targets)
- Create a new DestroyAction.
- Parameters:
model
- the Grid from which to remove Actors.targets
- one or more Actors to remove.
apply
public void apply()
- Apply this Action.
Every target Actor must be at the Location it was in when this Action was created.
undo
public void undo()
- Roll back this Action.
None of the actors removed by this Action can exist in the Grid.
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
toString
public String toString()
- Overrides:
toString
in class Object