us.asciiroth.client.agents
Class Corvid

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.Corvid
All Implemented Interfaces:
Agent, Animated, Piece

public class Corvid
extends AbstractAnimatedAgent

A flying agent that steals the player's selected item, then attempts to run away. If it is killed, the stolen item drops to the floor. Whether a corvid is on the attack or on the run depends simply on whether it has an item or not. Corvids fire a color event when they die.


Field Summary
static Serializer<Corvid> SERIALIZER
          Type serializer.
 
Constructor Summary
Corvid(Color color)
          Constructor.
Corvid(Color color, Item item)
          Constructor.
 
Method Summary
 void onDie(Event event, Cell agentLoc)
          Called when the agent dies on a given cell.
 void onFrame(Context ctx, Cell cell, int frame)
          Animation callback, executed once each frame for each piece animated on the board.
 void onHit(Event event, Cell attackerLoc, Cell agentLoc, Agent agent)
          Fired when this agent collides with the player, or if this agent is the player, when the player collides with another agent (in other words, this method will not fire if one non-player agent collides with another non-player agent).
 void onHitBy(Event event, Cell agentLoc, Agent agent, Direction dir)
          Called when this agent is hit by another agent (another agent collides with it).
 void onHitBy(Event event, Cell itemLoc, Item item, Direction dir)
          Called when this agent is hit by another item, either by being thrown, or by being wielded by the player.
 
Methods inherited from class us.asciiroth.client.agents.AbstractAnimatedAgent
randomSeed
 
Methods inherited from class us.asciiroth.client.agents.AbstractAgent
canEnter, changeHealth
 
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<Corvid> SERIALIZER
Type serializer.

Constructor Detail

Corvid

public Corvid(Color color)
Constructor.

Parameters:
color -

Corvid

public Corvid(Color color,
              Item item)
Constructor.

Parameters:
color -
item -
Method Detail

onDie

public void onDie(Event event,
                  Cell agentLoc)
Description copied from interface: Agent
Called when the agent dies on a given cell.

Specified by:
onDie in interface Agent
Overrides:
onDie in class AbstractAgent

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.


onHit

public void onHit(Event event,
                  Cell attackerLoc,
                  Cell agentLoc,
                  Agent agent)
Description copied from interface: Agent
Fired when this agent collides with the player, or if this agent is the player, when the player collides with another agent (in other words, this method will not fire if one non-player agent collides with another non-player agent).

Specified by:
onHit in interface Agent
Overrides:
onHit in class AbstractAgent

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

onHitBy

public void onHitBy(Event event,
                    Cell itemLoc,
                    Item item,
                    Direction dir)
Description copied from interface: Agent
Called when this agent is hit by another item, either by being thrown, or by being wielded by the player.

Specified by:
onHitBy in interface Agent
Overrides:
onHitBy in class AbstractAgent

0.7

© 2009 Alx Dark