us.asciiroth.client.terrain
Class Bridge
java.lang.Object
us.asciiroth.client.core.AbstractPiece
us.asciiroth.client.terrain.AbstractTerrain
us.asciiroth.client.terrain.Bridge
- All Implemented Interfaces:
- Piece, Terrain
public class Bridge
- extends AbstractTerrain
A bridge you can walk over. We used to use the Pier piece in early maps to
create bridges, but it was ugly even by the standards of ASCII art. This is
a little more bridgish.
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. |
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 |
onEnter(Event event,
Player player,
Cell cell,
Direction dir)
Agent attempting to leave the from cell, heading
toward the to cell. |
void |
onExit(Event event,
Player player,
Cell cell,
Direction dir)
Agent attempting to exit 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<Bridge> SERIALIZER
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 AbstractTerrain
- 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)
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)
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 AbstractTerrain
onExit
public void onExit(Event event,
Player player,
Cell cell,
Direction dir)
- Description copied from interface:
Terrain
- Agent attempting to exit the
from
cell, heading
toward the to
cell. The terrain being used is the
from
cell terrain, and the agent is still in the from
cell. If the event is canceled at this point, the agent will not be able
leave this cell. The move will be canceled. This event is fired for the
player as well as all other agents
- Specified by:
onExit
in interface Terrain
- Overrides:
onExit
in class AbstractTerrain
© 2009 Alx Dark