us.asciiroth.client.terrain.decorators
Class PitTrap
java.lang.Object
us.asciiroth.client.core.AbstractPiece
us.asciiroth.client.terrain.decorators.Decorator
us.asciiroth.client.terrain.decorators.Mimic
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...
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 java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SERIALIZER
public static final Serializer<PitTrap> SERIALIZER
- Type serializer.
PitTrap
public PitTrap()
- Constructor.
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
© 2009 Alx Dark