|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object us.asciiroth.client.board.Board
public class Board
The main model object in the game, the board represents the entire map and all the pieces on it.
Field Summary | |
---|---|
static int |
COLUMNS
The size of boards in columns. |
static int |
ROWS
The size of boards in rows. |
Constructor Summary | |
---|---|
Board()
Constructor. |
Method Summary | |
---|---|
Cell |
find(CellFilter filter)
|
java.util.List<Cell> |
findAdjacent(Cell start,
CellFilter filter)
Starting at a specific cell, test adjacent cells with the selector and continue finding and selecting adjacent cells until no adjacent cells match. |
Cell |
findRandomCell()
Find a random cell that an item could be placed on that the player should be able to enter in order to pick up the item (cells that have traversable terrain). |
void |
fireColorEvent(Context ctx,
Color color,
Cell origin)
Fire a color-related trigger across the board. |
java.lang.String |
getAdjacentBoard(Direction direction)
Get a board adjacent to the current board in the indicated direction. |
Cell |
getAdjacentCell(int x,
int y,
Direction dir)
Given a location on the board and a direction, get the adjacent cell. |
java.util.List<AnimationProxy> |
getAnimated()
Get the list of pieces currently on the board that are animated. |
Cell |
getCellAt(int x,
int y)
Get the cell at the given coordinates |
java.lang.String |
getCreator()
|
Cell |
getCurrentCell()
Get the cell currently occupied by the player. |
java.lang.String |
getDescription()
|
java.lang.String |
getMusic()
|
java.lang.String |
getScenarioName()
|
java.lang.String |
getStartInventory()
|
int |
getStartX()
Get the start X position of the board. |
int |
getStartY()
Get the start Y position of the board. |
boolean |
hasNonTransientEffect()
If the board is serialized (player leaves board or saves) while there are effects that are not transient, then saving will be delayed until these effects are played out. |
boolean |
isOutside()
Is the terrain represented by this board above-ground? |
void |
rerenderBoard()
|
void |
setAdjacentBoard(java.lang.String direction,
java.lang.String boardID)
Set an adjacent board. |
void |
setCreator(java.lang.String creator)
|
void |
setDescription(java.lang.String description)
|
void |
setMusic(java.lang.String music)
|
void |
setOutside(boolean outside)
|
void |
setScenarioName(java.lang.String scenarioName)
|
void |
setStartInventory(java.lang.String startInventory)
|
void |
setStartXY(int x,
int y)
Set the starting X/Y coordinates of the player on this board. |
void |
visit(CellVisitor visitor)
Visit every cell on the board, for whatever reason. |
void |
visitRange(Cell center,
int range,
boolean includeCenter,
CellVisitor visitor)
This searches a square of the board, centered on the range, from the closest to the most distant squares, up and including the range of cells (so a range of 3 searches up to 3 cells away). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int COLUMNS
public static final int ROWS
Constructor Detail |
---|
public Board()
Method Detail |
---|
public Cell find(CellFilter filter)
public java.util.List<Cell> findAdjacent(Cell start, CellFilter filter)
start
- filter
-
public Cell findRandomCell()
public void fireColorEvent(Context ctx, Color color, Cell origin)
onTrigger
method fired. Each terrain type can have behavior
under these circumstances. Triggers set up conditions for when such
an event can occur.
ctx
- context object containing game statecolor
- the color of the event; colorEvent
will
be called on all terrain of this colorpublic java.lang.String getAdjacentBoard(Direction direction)
direction
-
public Cell getAdjacentCell(int x, int y, Direction dir)
x
- the x location of the starting celly
- the y location of the starting celldir
- the direction to retrieve the adjacent cell from
public java.util.List<AnimationProxy> getAnimated()
public Cell getCellAt(int x, int y)
x
- y
-
public java.lang.String getCreator()
public Cell getCurrentCell()
public java.lang.String getDescription()
public java.lang.String getMusic()
public java.lang.String getScenarioName()
public java.lang.String getStartInventory()
public int getStartX()
public int getStartY()
public boolean hasNonTransientEffect()
public boolean isOutside()
public void rerenderBoard()
public void setAdjacentBoard(java.lang.String direction, java.lang.String boardID)
direction
- the direction of the boardboardID
- the boardID of the new board.public void setCreator(java.lang.String creator)
public void setDescription(java.lang.String description)
public void setMusic(java.lang.String music)
public void setOutside(boolean outside)
outside
- public void setScenarioName(java.lang.String scenarioName)
public void setStartInventory(java.lang.String startInventory)
public void setStartXY(int x, int y)
x
- y
- public void visit(CellVisitor visitor)
visitor
- public void visitRange(Cell center, int range, boolean includeCenter, CellVisitor visitor)
|
0.7 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
© 2009 Alx Dark