|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Agent
Interface for pieces that exclusively occupy a cell. There can only be one agent in a cell at a time, although not all agents are animate and move around. Things that are usefully placed "on" different kinds of terrain can be modeled as agents.
Method Summary | |
---|---|
boolean |
canEnter(Direction direction,
Cell from,
Cell to)
Can the agent enter this terrain? This method mirrors the same method in Terrain, and both most return true for the agent to be able to move. |
int |
changeHealth(int value)
Change health. |
void |
onDie(Event event,
Cell cell)
Called when the agent dies on a given cell. |
void |
onHit(Event event,
Cell attackerCell,
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 interface us.asciiroth.client.core.Piece |
---|
getColor, getName, getSymbol, is, not |
Method Detail |
---|
boolean canEnter(Direction direction, Cell from, Cell to)
canExit
method
for agents, but it can be added if any piece ever needs it.
direction
- from
- to
-
Terrain.canEnter(Agent, Cell, Direction)
int changeHealth(int value)
value
- the damage to take or the adjustment to the percentage
chance to be hit.
void onDie(Event event, Cell cell)
event
- cell
- void onHit(Event event, Cell attackerCell, Cell agentLoc, Agent agent)
event
- attackerCell
- agentLoc
- agent
- void onHitBy(Event event, Cell agentLoc, Agent agent, Direction dir)
event
- agentLoc
- agent
- dir
- void onHitBy(Event event, Cell itemLoc, Item item, Direction dir)
event
- itemLoc
- item
- dir
-
|
0.7 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
© 2009 Alx Dark