Class Slider

  extended by us.asciiroth.client.core.AbstractPiece
      extended by us.asciiroth.client.agents.AbstractAgent
          extended by 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.

Field Summary
static Serializer<Slider> SERIALIZER
          Type serializer.
Constructor Summary
Slider(Direction dir)
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 us.asciiroth.client.agents.AbstractAgent
canEnter, changeHealth, onDie, onHit, onHitBy
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<Slider> SERIALIZER
Type serializer.

Constructor Detail


public Slider(Direction dir)

dir - either "north" or "east"
Method Detail


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
onHitBy in class AbstractAgent


2009 Alx Dark