many changes :P
This commit is contained in:
@@ -4,6 +4,9 @@
|
||||
#include "GridNodeBBox.h"
|
||||
#include "GridPoint.h"
|
||||
|
||||
template<int, typename> class Grid;
|
||||
|
||||
|
||||
/**
|
||||
* INTERNAL DATASTRUCTURE
|
||||
* this data-structure is internally used by the Grid
|
||||
@@ -17,17 +20,26 @@ class GridNode {
|
||||
/** INTERNAL: array-index */
|
||||
int _idx = -1;
|
||||
|
||||
/** INTERNAL: store neighbors (via index) */
|
||||
/** INTERNAL: number of neighbors */
|
||||
int _numNeighbors = 0;
|
||||
|
||||
/** INTERNAL: number of neighbors */
|
||||
int _neighbors[10] = {};
|
||||
/** INTERNAL: store neighbors (via index) */
|
||||
int _neighbors[12] = {};
|
||||
|
||||
public:
|
||||
|
||||
GridNode() {;}
|
||||
|
||||
/** get the node's index within its grid */
|
||||
int getIdx() const {return _idx;}
|
||||
|
||||
/** get the number of neighbors for this node */
|
||||
int getNumNeighbors() const {return _numNeighbors;}
|
||||
|
||||
/** get the n-th neighbor for this node */
|
||||
template <int gridSize_cm, typename T> inline T& getNeighbor(const int nth, const Grid<gridSize_cm, T>& grid) const {
|
||||
return grid.getNeighbor(_idx, nth);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user