us.asciiroth.client.terrain
Class FarthapodNest
java.lang.Object
us.asciiroth.client.core.AbstractPiece
us.asciiroth.client.terrain.AbstractTerrain
us.asciiroth.client.terrain.FarthapodNest
- All Implemented Interfaces:
- ColorListener, Piece, Terrain
public class FarthapodNest
- extends AbstractTerrain
- implements ColorListener
An AgentCreator
specifically for Farthapod
s. It listens for
color events, presumably triggered by dying Farthapod
s, and creates replacements.
Method Summary |
boolean |
canExit(Agent agent,
Cell cell,
Direction direction)
Can the (non-player) agent exit this terrain? Without regard to side
effects, this method should determine if the agent can actually move into
the cell. |
void |
onAgentExit(Event event,
Agent agent,
Cell cell,
Direction dir)
The farthapods can get out, however. |
void |
onColorEvent(Context ctx,
Cell cell,
Cell origin)
Terrain has received a color event, probably related to the
firing of a color event on the board. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SERIALIZER
public static final Serializer<FarthapodNest> SERIALIZER
FarthapodNest
public FarthapodNest(Color color)
- Constructor.
- Parameters:
color
-
canExit
public boolean canExit(Agent agent,
Cell cell,
Direction direction)
- Description copied from interface:
Terrain
- Can the (non-player) agent exit this terrain? Without regard to side
effects, this method should determine if the agent can actually move into
the cell. Error on the side of caution and return false if the answer
is ambiguous.
- Specified by:
canExit
in interface Terrain
- Overrides:
canExit
in class AbstractTerrain
- Returns:
- true if the agent can leave this cell going in the indicated
direction
- See Also:
Cell.canEnter(Cell, Agent, Direction, boolean)
onAgentExit
public void onAgentExit(Event event,
Agent agent,
Cell cell,
Direction dir)
- The farthapods can get out, however.
- Specified by:
onAgentExit
in interface Terrain
- Overrides:
onAgentExit
in class AbstractTerrain
onColorEvent
public void onColorEvent(Context ctx,
Cell cell,
Cell origin)
- Description copied from interface:
ColorListener
- Terrain has received a color event, probably related to the
firing of a color event on the board. Different terrain behave
differently when triggered, most flip between a set of states.
- Specified by:
onColorEvent
in interface ColorListener
- Parameters:
ctx
- a context object with references to game state
© 2009 Alx Dark