us.asciiroth.client.agents
Class Tumbleweed

java.lang.Object
  extended by us.asciiroth.client.core.AbstractPiece
      extended by us.asciiroth.client.agents.AbstractAgent
          extended by us.asciiroth.client.agents.AbstractAnimatedAgent
              extended by us.asciiroth.client.agents.Tumbleweed
All Implemented Interfaces:
Agent, Animated, Piece

public class Tumbleweed
extends AbstractAnimatedAgent

A decorative piece that tumbles across the board in the indicated direction. It doesn't really do anything but lend color to desert boards. By the gods, this piece was complicated to make...


Field Summary
static Serializer<Tumbleweed> SERIALIZER
          Type serializer.
 
Constructor Summary
Tumbleweed(Direction direction)
          Constructor.
 
Method Summary
 void onFrame(Context ctx, Cell cell, int frame)
          Animation callback, executed once each frame for each piece animated on the board.
 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.AbstractAnimatedAgent
randomSeed
 
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

SERIALIZER

public static final Serializer<Tumbleweed> SERIALIZER
Type serializer.

Constructor Detail

Tumbleweed

public Tumbleweed(Direction direction)
Constructor.

Parameters:
direction - the direction the tumbleweed will tumble
Method Detail

onFrame

public void onFrame(Context ctx,
                    Cell cell,
                    int frame)
Description copied from interface: Animated
Animation callback, executed once each frame for each piece animated on the board.


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

0.7

© 2009 Alx Dark