us.asciiroth.client.terrain
Class FarthapodNest

java.lang.Object
  extended by us.asciiroth.client.core.AbstractPiece
      extended by us.asciiroth.client.terrain.AbstractTerrain
          extended by us.asciiroth.client.terrain.FarthapodNest
All Implemented Interfaces:
ColorListener, Piece, Terrain

public class FarthapodNest
extends AbstractTerrain
implements ColorListener

An AgentCreator specifically for Farthapods. It listens for color events, presumably triggered by dying Farthapods, and creates replacements.


Field Summary
static Serializer<FarthapodNest> SERIALIZER
           
 
Constructor Summary
FarthapodNest(Color color)
          Constructor.
 
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 us.asciiroth.client.terrain.AbstractTerrain
canEnter, onAdjacentTo, onAgentEnter, onDrop, onEnter, onExit, onFlyOver, onNotAdjacentTo, onPickup
 
Methods inherited from class us.asciiroth.client.core.AbstractPiece
getColor, getName, getSymbol, is, not
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface us.asciiroth.client.core.Piece
getColor, getName, getSymbol, is, not
 

Field Detail

SERIALIZER

public static final Serializer<FarthapodNest> SERIALIZER
Constructor Detail

FarthapodNest

public FarthapodNest(Color color)
Constructor.

Parameters:
color -
Method Detail

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

0.7

© 2009 Alx Dark