us.asciiroth.client.terrain
Class Pit

java.lang.Object
  extended by us.asciiroth.client.core.AbstractPiece
      extended by us.asciiroth.client.terrain.AbstractTerrain
          extended by 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.


Field Summary
static Serializer<Pit> SERIALIZER
          Type serializer.
 
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 us.asciiroth.client.terrain.AbstractTerrain
canExit, onAdjacentTo, onAgentExit, onExit, onFlyOver, 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<Pit> SERIALIZER
Type serializer.

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 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

0.7

2009 Alx Dark