us.asciiroth.client.terrain.decorators
Class PitTrap

java.lang.Object
  extended by us.asciiroth.client.core.AbstractPiece
      extended by us.asciiroth.client.terrain.decorators.Decorator
          extended by us.asciiroth.client.terrain.decorators.Mimic
              extended by us.asciiroth.client.terrain.decorators.PitTrap
All Implemented Interfaces:
ColorListener, Piece, Terrain, TerrainProxy

public class PitTrap
extends Mimic

A hidden pit. It behaves like a pit in most respects and if anything falls into it, the pit will become apparent to the player. However, if the player walks onto the pit while it is still hidden, he or she will fall through to the map below the current board (so there has to be a "down" map or the hidden pit will be the source of errors). Like other mimics, it can be detected with the detect hidden ability.

Yes, agents walk right over these things...


Field Summary
static Serializer<PitTrap> SERIALIZER
          Type serializer.
 
Constructor Summary
PitTrap()
          Constructor.
 
Method Summary
 boolean canEnter(Agent agent, Cell cell, Direction direction)
          Can the (non-player) agent enter this terrain? Without regard to side effects, this method should determine if the agent can actually move into the cell.
 void onAgentEnter(Event event, Agent agent, Cell cell, Direction dir)
           
 void onEnter(Event event, Player player, Cell cell, Direction dir)
          Agent attempting to leave the from cell, heading toward the to cell.
 
Methods inherited from class us.asciiroth.client.terrain.decorators.Mimic
getProxiedTerrain, getSymbol, onAdjacentTo, onNotAdjacentTo, proxy
 
Methods inherited from class us.asciiroth.client.terrain.decorators.Decorator
canExit, is, not, onAgentExit, onColorEvent, onDrop, onExit, onFlyOver, onPickup
 
Methods inherited from class us.asciiroth.client.core.AbstractPiece
getColor, getName
 
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
 

Field Detail

SERIALIZER

public static final Serializer<PitTrap> SERIALIZER
Type serializer.

Constructor Detail

PitTrap

public PitTrap()
Constructor.

Method Detail

canEnter

public boolean canEnter(Agent agent,
                        Cell cell,
                        Direction direction)
Description copied from interface: Terrain
Can the (non-player) agent enter 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:
canEnter in interface Terrain
Overrides:
canEnter in class Decorator
Returns:
true if the agent can enter the terrain moving between the two cells using the indicated direction
See Also:
Cell.canEnter(Cell, Agent, Direction, boolean)

onAgentEnter

public void onAgentEnter(Event event,
                         Agent agent,
                         Cell cell,
                         Direction dir)
Specified by:
onAgentEnter in interface Terrain
Overrides:
onAgentEnter in class Decorator

onEnter

public void onEnter(Event event,
                    Player player,
                    Cell cell,
                    Direction dir)
Description copied from interface: Terrain
Agent attempting to leave the from cell, heading toward the to cell. The terrain being used is the terrain of the to cell. The agent is still in the from
Specified by:
onEnter in interface Terrain
Overrides:
onEnter in class Decorator

0.7

2009 Alx Dark