us.asciiroth.client.terrain
Class Pit
java.lang.Object
us.asciiroth.client.core.AbstractPiece
us.asciiroth.client.terrain.AbstractTerrain
us.asciiroth.client.terrain.Pit
- All Implemented Interfaces:
- Piece, Terrain
public class Pit
- extends AbstractTerrain
Impassable but items can be thrown across it. If an item lands such that
it should fall into a pit, it'll disappear. Boulders can be used to "plug"
pits and turn them into passable Floor
terrain.
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 |
onDrop(Event event,
Cell cell,
Item item)
Item is going to drop onto the terrain at this point. |
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<Pit> SERIALIZER
- Type 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)
onAgentEnter
public void onAgentEnter(Event event,
Agent agent,
Cell cell,
Direction dir)
- Specified by:
onAgentEnter
in interface Terrain
- Overrides:
onAgentEnter
in class AbstractTerrain
onDrop
public void onDrop(Event event,
Cell cell,
Item item)
- Description copied from interface:
Terrain
- Item is going to drop onto the terrain at this point. If the event
if canceled at this point, then the item will simply disappear
from the board.
- Specified by:
onDrop
in interface Terrain
- Overrides:
onDrop
in class AbstractTerrain
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
© 2009 Alx Dark