us.asciiroth.client.terrain
Class Switch
java.lang.Object
us.asciiroth.client.core.AbstractPiece
us.asciiroth.client.terrain.AbstractTerrain
us.asciiroth.client.terrain.Switch
- All Implemented Interfaces:
- Piece, Terrain
public class Switch
- extends AbstractTerrain
A switch. If the player "touches" it, it will fire a color event
on the board, matching the switch's color.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SERIALIZER
public static final Serializer<Switch> SERIALIZER
- Type serializer.
getState
public State getState()
- Get the state of this switch. On/off doesn't really matter so much
here as that every activation of the switch causes it to change
appearance and fire a color event.
- Returns:
- the trigger state (on or off)
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
onFlyOver
public void onFlyOver(Event event,
Cell cell,
InFlightItem flier)
- You can throw things at switches and trigger them, but you can't shoot
at them.
- Specified by:
onFlyOver
in interface Terrain
- Overrides:
onFlyOver
in class AbstractTerrain
- Parameters:
event
- cell
- flier
-
© 2009 Alx Dark