|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectus.asciiroth.client.terrain.TerrainUtils
public class TerrainUtils
Terrain utilities.
Constructor Summary | |
---|---|
TerrainUtils()
|
Method Summary | |
---|---|
static Cell |
getCellOnOppositeSide(Cell cell,
Direction direction)
To support animated pieces that loop around the board, this method returns the approximate cell located on the opposite side of the board. |
static Cell |
getRandomCell(java.util.List<Cell> cells)
Give a list of cells, choose one at random. |
static Direction |
getRandomDirection()
Given a list of directions, choose one at random. |
static Terrain |
getTerrainOtherState(Terrain terrain,
State state)
Get this terrain piece but with its state toggled.If a piece is supplied that does not have state, it will simply be returned by this method. |
static Terrain |
getTerrainWithReverseDirection(Cell cell,
Direction dir)
Given a cell with a terrain that has a direction, and the current direction of that terrain, this method creates and caches a terrain piece with an opposite direction. |
static void |
removeDecorator(Event event,
TerrainProxy terrain)
|
static void |
toggleCellState(Cell cell,
Terrain terrain,
State state)
Assuming the indicated cell has a terrain type with state, this method toggles the state on/off and then changes the terrain for that cell. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TerrainUtils()
Method Detail |
---|
public static Cell getCellOnOppositeSide(Cell cell, Direction direction)
cell
- direction
-
public static Cell getRandomCell(java.util.List<Cell> cells)
cells
-
public static Direction getRandomDirection()
public static Terrain getTerrainOtherState(Terrain terrain, State state)
toggleCellState
prevents this.
terrain
- state
-
public static Terrain getTerrainWithReverseDirection(Cell cell, Direction dir)
cell
- the target celldir
- the current direction of the terrain
public static void removeDecorator(Event event, TerrainProxy terrain)
public static void toggleCellState(Cell cell, Terrain terrain, State state)
cell
- state
-
|
0.7 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
© 2009 Alx Dark