T - only classes implementing NavigationGridGraphNode can be used within this graphpublic interface NavigationGridGraph<T extends NavigationGridGraphNode> extends NavigationGraph<T>
NavigationGraph which is represented as a grid or a table.
The nodes are accessible through (x, y) coordinates.
The default implementation is GridCell.| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(int x,
int y)
Determine wether the given x,y pair is within the bounds of this grid
|
T |
getCell(int x,
int y) |
int |
getHeight() |
T[][] |
getNodes() |
int |
getWidth() |
boolean |
isWalkable(int x,
int y)
Determine whether the node at the given position is walkable.
|
void |
setCell(int x,
int y,
T node) |
void |
setHeight(int height) |
void |
setNodes(T[][] nodes) |
void |
setWalkable(int x,
int y,
boolean walkable)
Set whether the node on the given position is walkable.
|
void |
setWidth(int width) |
getMovementCost, getNeighbors, getNeighbors, isWalkable, lineOfSightT getCell(int x, int y)
void setCell(int x,
int y,
T node)
boolean contains(int x,
int y)
x - - The x / column coordinate of the node.y - - The y / row coordinate of the node.void setWalkable(int x,
int y,
boolean walkable)
x - - The x / column coordinate of the node.y - - The y / row coordinate of the node.walkable - - Whether the position is walkable.java.lang.IndexOutOfBoundsException - if the coordinate is not inside the grid.boolean isWalkable(int x,
int y)
x - - The x / column coordinate of the node.y - - The y / row coordinate of the node.T[][] getNodes()
void setNodes(T[][] nodes)
int getWidth()
void setWidth(int width)
int getHeight()
void setHeight(int height)