us.asciiroth.client.terrain
Class BeeHive

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

public class BeeHive
extends AbstractTerrain
implements ColorListener

A special kind of AgentCreator that creates bees when it receives a color event, presumably fired from the death of another KillerBee on the board.


Field Summary
static Serializer<BeeHive> SERIALIZER
           
 
Constructor Summary
BeeHive(Color color)
           
BeeHive(Color color, State state)
          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 bees 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.
 void onEnter(Event event, Player player, Cell cell, Direction dir)
          You really shouldn't walk into a bee hive.
 void onFlyOver(Event event, Cell cell, InFlightItem flier)
          Terrain has an item flying over it.
 
Methods inherited from class us.asciiroth.client.terrain.AbstractTerrain
canEnter, onAdjacentTo, onAgentEnter, onDrop, onExit, 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<BeeHive> SERIALIZER
Constructor Detail

BeeHive

public BeeHive(Color color)

BeeHive

public BeeHive(Color color,
               State state)
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 bees 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

onEnter

public void onEnter(Event event,
                    Player player,
                    Cell cell,
                    Direction dir)
You really shouldn't walk into a bee hive. These bees fight to the death.

Specified by:
onEnter in interface Terrain
Overrides:
onEnter in class AbstractTerrain

onFlyOver

public void onFlyOver(Event event,
                      Cell cell,
                      InFlightItem flier)
Description copied from interface: Terrain
Terrain has an item flying over it. If the event is canceled at this point, the item will fall to the ground on this cell.

Specified by:
onFlyOver in interface Terrain
Overrides:
onFlyOver in class AbstractTerrain

0.7

2009 Alx Dark