|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object us.asciiroth.client.agents.AgentProxy us.asciiroth.client.agents.Statue
public class Statue
A statue. Statues represent an agent, and in fact, can be turned into that agent on a color event. However, you can't wrap a player with this currently because the player cannot be serialized like that.
Field Summary | |
---|---|
static Serializer<Statue> |
SERIALIZER
Type serializer. |
Constructor Summary | |
---|---|
Statue(Agent agent,
Color color)
Constructor. |
Method Summary | |
---|---|
int |
changeHealth(int value)
Change health. |
Color |
getColor()
What is the color of this piece? While many piece types are permanently of color "None", many more can be parameterized with a color in order to tie them together through color-based events. |
java.lang.String |
getName()
The visible name of the piece. |
Symbol |
getSymbol()
The symbol to display for this piece. |
void |
onColorEvent(Context ctx,
Cell cell,
Cell origin)
On a color trigger, the statue turns into the agent it represents. |
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). |
boolean |
randomSeed()
Should this animation start with a randomly seeded number as its first frame? For some animations, this can prevent all presentations of the piece on the board executing the same animation frame at the same time. |
Methods inherited from class us.asciiroth.client.agents.AgentProxy |
---|
canEnter, getAgent, is, not, onDie, onHit, onHitBy |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Serializer<Statue> SERIALIZER
Constructor Detail |
---|
public Statue(Agent agent, Color color)
agent
- color
- Method Detail |
---|
public int changeHealth(int value)
Agent
changeHealth
in interface Agent
changeHealth
in class AgentProxy
value
- the damage to take or the adjustment to the percentage
chance to be hit.
public Color getColor()
Piece
getColor
in interface Piece
getColor
in class AgentProxy
public java.lang.String getName()
Piece
getName
in interface Piece
getName
in class AgentProxy
public Symbol getSymbol()
Piece
getSymbol
in interface Piece
getSymbol
in class AgentProxy
public void onColorEvent(Context ctx, Cell cell, Cell origin)
onColorEvent
in interface ColorListener
ctx
- a context object with references to game statepublic void onFrame(Context ctx, Cell cell, int frame)
Animated
onFrame
in interface Animated
onFrame
in class AgentProxy
public void onHitBy(Event event, Cell agentLoc, Agent agent, Direction dir)
Agent
onHitBy
in interface Agent
onHitBy
in class AgentProxy
public boolean randomSeed()
Animated
randomSeed
in interface Animated
|
0.7 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
© 2009 Alx Dark