us.asciiroth.client.agents
Class Slider
java.lang.Object
us.asciiroth.client.core.AbstractPiece
us.asciiroth.client.agents.AbstractAgent
us.asciiroth.client.agents.Slider
- All Implemented Interfaces:
- Agent, Piece
public class Slider
- extends AbstractAgent
A puzzle piece that can slide up-down or left-right when pushed.
It can be pushed behind a boulder, but will not push a boulder.
It will fall into a pit.
Method Summary |
void |
onHitBy(Event event,
Cell agentLoc,
Agent agent,
Direction dir)
Called when this agent is hit by another agent (another agent collides
with it). |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SERIALIZER
public static final Serializer<Slider> SERIALIZER
- Type serializer.
Slider
public Slider(Direction dir)
- Constructor.
- Parameters:
dir
- either "north" or "east"
onHitBy
public void onHitBy(Event event,
Cell agentLoc,
Agent agent,
Direction dir)
- Description copied from interface:
Agent
- Called when this agent is hit by another agent (another agent collides
with it). Typically the move event will be cancelled in this method,
unless this agent moves itself out of the way, such as boulders attempt to do.
- Specified by:
onHitBy
in interface Agent
- Overrides:
onHitBy
in class AbstractAgent
© 2009 Alx Dark