|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object us.asciiroth.client.core.AbstractPiece us.asciiroth.client.terrain.AbstractTerrain us.asciiroth.client.terrain.Door
public class Door
A door that can be open (unlocked) or closed (locked). In the latter case, it can only be opened by a color event for the color of the door, or by the use of a key of the same color as the door.
Field Summary | |
---|---|
static Serializer<Door> |
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. |
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. |
State |
getState()
Get state of door |
void |
onAgentEnter(Event event,
Agent agent,
Cell cell,
Direction dir)
|
void |
onAgentExit(Event event,
Agent agent,
Cell cell,
Direction dir)
|
void |
onColorEvent(Context ctx,
Cell cell,
Cell origin)
Terrain has received a color event, probably related to the firing of a color event on the board. |
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. |
void |
onFlyOver(Event event,
Cell cell,
InFlightItem flier)
Terrain has an item flying over it. |
Methods inherited from class us.asciiroth.client.terrain.AbstractTerrain |
---|
onAdjacentTo, onDrop, 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 |
---|
public static final Serializer<Door> SERIALIZER
Method Detail |
---|
public boolean canEnter(Agent agent, Cell cell, Direction direction)
Terrain
canEnter
in interface Terrain
canEnter
in class AbstractTerrain
Cell.canEnter(Cell, Agent, Direction, boolean)
public boolean canExit(Agent agent, Cell cell, Direction direction)
Terrain
canExit
in interface Terrain
canExit
in class AbstractTerrain
Cell.canEnter(Cell, Agent, Direction, boolean)
public State getState()
public void onAgentEnter(Event event, Agent agent, Cell cell, Direction dir)
onAgentEnter
in interface Terrain
onAgentEnter
in class AbstractTerrain
public void onAgentExit(Event event, Agent agent, Cell cell, Direction dir)
onAgentExit
in interface Terrain
onAgentExit
in class AbstractTerrain
public void onColorEvent(Context ctx, Cell cell, Cell origin)
ColorListener
onColorEvent
in interface ColorListener
ctx
- a context object with references to game statepublic void onEnter(Event event, Player player, Cell cell, Direction dir)
Terrain
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
public void onExit(Event event, Player player, Cell cell, Direction dir)
Terrain
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
onExit
in interface Terrain
onExit
in class AbstractTerrain
public void onFlyOver(Event event, Cell cell, InFlightItem flier)
Terrain
onFlyOver
in interface Terrain
onFlyOver
in class AbstractTerrain
|
0.7 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
© 2009 Alx Dark