|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object us.asciiroth.client.board.Cell
public class Cell
Method Summary | |
---|---|
boolean |
canEnter(Cell agentLoc,
Agent agent,
Direction dir,
boolean targetPlayer)
Can the agent enter this cell, accounting both for the terrain type and the presence of other agents, as well as the intent of the agent (attack player vs. |
boolean |
containsPlayer()
Does this cell contain the player? This method is more effective than testing the agent using the instanceof operator because it accounts for
the fact that the player may be wrapped by an AgentProxy . |
void |
createCloud(java.lang.Class<? extends Effect> c)
|
boolean |
equals(java.lang.Object obj)
|
void |
explosion(Player player)
|
Cell |
getAdjacentCell(Direction direction)
Get the cell adjacent to the current cell in the indicated direction. |
java.util.List<Cell> |
getAdjacentCells(CellFilter filter)
|
Agent |
getAgent()
|
Terrain |
getApparentTerrain()
Get the terrain of this cell as it appears to the player. |
ItemBag |
getBag()
|
Board |
getBoard()
|
ModifiableSymbol |
getCurrentSymbol(Piece piece,
Symbol symbol)
Accounting for the layering of pieces on this cell, what would the union of the pieces be in a symbol? |
EffectBag |
getEffects()
The thrown or shot objects currently over this cell. |
com.google.gwt.user.client.Element |
getTd()
|
Terrain |
getTerrain()
Get the terrain of this cell. |
double |
getVisited()
The timestamp of the last time the player visited this cell, during the current occupation of the board by the player (the information is wiped out when the player leaves the board). |
int |
getX()
|
int |
getY()
|
int |
hashCode()
|
boolean |
hasNoEffects()
Are there effects (thrown or shot pieces) in this cell. |
boolean |
hasOpeningEffect()
|
Cell |
init(Board board)
|
boolean |
isBagEmpty()
Check to see if there are items in this cell. |
void |
moveAgentTo(Cell next,
Agent agent)
Move an agent to another cell. |
void |
onSteppedOn(Event event,
Cell agentLoc,
Agent agent)
|
void |
openContainer(java.lang.String string,
Item item,
int count,
java.lang.Class<?> c)
Animation and related behavior for opening a crate or chest. |
void |
removeAgent(Agent agent)
Remove the agent current on this square. |
void |
setAgent(Agent agent)
Set the agent occupying this square. |
void |
setTerrain(Terrain newTerrain)
|
void |
setTerrain(Terrain newTerrain,
boolean forceProxyReplace)
Set the terrain for this cell. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public boolean canEnter(Cell agentLoc, Agent agent, Direction dir, boolean targetPlayer)
agentLoc
- agent
- targetPlayer
-
public boolean containsPlayer()
instanceof
operator because it accounts for
the fact that the player may be wrapped by an AgentProxy
. It is
analogous to getApparentTerrain() in this regard.
public void createCloud(java.lang.Class<? extends Effect> c)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public void explosion(Player player)
public Cell getAdjacentCell(Direction direction)
direction
- - the direction in which the adjacent cell is located,
relative to this cell
public java.util.List<Cell> getAdjacentCells(CellFilter filter)
public Agent getAgent()
public Terrain getApparentTerrain()
public ItemBag getBag()
public Board getBoard()
public ModifiableSymbol getCurrentSymbol(Piece piece, Symbol symbol)
piece
- symbol
-
public EffectBag getEffects()
public com.google.gwt.user.client.Element getTd()
public Terrain getTerrain()
public double getVisited()
public int getX()
public int getY()
public int hashCode()
hashCode
in class java.lang.Object
public boolean hasNoEffects()
getEffects().isEmpty()
.
public boolean hasOpeningEffect()
public Cell init(Board board)
public boolean isBagEmpty()
getBag().isEmpty()
.
public void moveAgentTo(Cell next, Agent agent)
next
- the cell to move the agent toagent
- the agent to be movedpublic void onSteppedOn(Event event, Cell agentLoc, Agent agent)
public void openContainer(java.lang.String string, Item item, int count, java.lang.Class<?> c)
string
- the name of the containeritem
- the item in the container (can be null)count
- the number of items in the containerc
- the class of terrain being opened (Chest or Crate)public void removeAgent(Agent agent)
agent
- public void setAgent(Agent agent)
removeAgent
. An existing agent on this square will be removed,
so you must be careful when calling this method. The controller methods
include logic for pushing agents, and similar behavior, that cannot be
expressed here.
agent
- public void setTerrain(Terrain newTerrain)
public void setTerrain(Terrain newTerrain, boolean forceProxyReplace)
newTerrain
- forceProxyReplace
- force any proxy in this cell to be replaced
(so far only the editor needs to do this)
|
0.7 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
© 2009 Alx Dark