Construct a list of neighbours for each accessible node/cell in a grid. More...
#include <AdjacencyList.h>
Public Member Functions | |
void | generateFrom (const Grid2D &grid) |
Generate adjacency list from a grid. More... | |
const std::vector< Index > & | getNeighbours (const Index &index) const |
Get the neighbours of a node at a certain position in the grid. More... | |
Construct a list of neighbours for each accessible node/cell in a grid.
An accessible node is one that does not contain an obstacle and it is not a solid tile
Definition at line 42 of file AdjacencyList.h.
void ime::AdjacencyList::generateFrom | ( | const Grid2D & | grid | ) |
Generate adjacency list from a grid.
grid | grid to generate adjacency list for |
This function will generate a list of neighbouring tiles for each node/tile in the grid. This functions assumes that the grid nodes are bidirectional
Get the neighbours of a node at a certain position in the grid.
index | Location of the tile to get the neighbours of |