Class Grid.Cell
raft.kilavuz.grid.Grid.Cell All Implemented Interfaces:
-
Enclosing class:
-
public class Grid.Cell
a cell in grid. cells are the atomic pieces of raw pathfinding information.
later they're collapsed into rectangular freely traversable regions called sectors
and portals between sectors.
Field Summary |
|
idid of this cell, assigned during creation |
|
xx coordinate in grid space |
|
zz coordinate in grid space |
Method Summary |
|
|
|
|
|
getGrid()returns enclosing grid instance |
|
getLocation()return location (bottom center) of cell in world space |
|
|
|
getSector()returns the sector this cells belong to |
|
|
|
|
|
remove()removes this cell from grid. |
|
toString()returns a string representation of this cell |
Field Detail
id
public final int id
-
id of this cell, assigned during creation
x
public final int x
-
x coordinate in grid space
z
public final int z
-
z coordinate in grid space
Method Detail
getElevation
public float getElevation()
-
returns elevation of this cell
getNeighbour
-
returns neighbour cell at given direction
-
Returns:
-
neighbour or null if no neighbour at that direction or neighbour
isnt reachable from this cell
getTransitions
-
returns a map of transitions from this cell.
keys are actions and values are list of cells.
note this method does not return the regular adjacent (neighbour) cells.
this type of transitions are either created by remote jumps during
floodfill or by the method Grid.createPortal(Cell, Cell, short).
-
See Also:
-
getAction
-
returns action to take to reach the neighbour at given direction
-
Returns:
-
action or null if no neighbour at that direction or neighbour
isnt reachable from this cell
getSector
-
returns the sector this cells belong to
-
Throws:
-
getLocation
-
return location (bottom center) of cell in world space
getGrid
-
returns enclosing grid instance
remove
public void remove()
-
removes this cell from grid.
this can be used for manually correcting some part of grid.
-
Throws:
-
Since:
-
0.91
See Also:
-
intersects
-
checks if two cells intersect.
toString
-
returns a string representation of this cell
Overrides:
-
DocFlex/Doclet is both a multi-format Javadoc doclet and a free edition of DocFlex/Javadoc. If you need to customize your Javadoc without writing a full-blown doclet from scratch, DocFlex/Javadoc may be the only tool able to help you! Find out more at www.docflex.com