added new sanity checks and compile-time assertions to prevent errors
fixed stair-building issue new test-cases added elevator support fixed/improved some walker modules
This commit is contained in:
@@ -18,6 +18,10 @@ template<typename> class Grid;
|
||||
*/
|
||||
struct GridNode {
|
||||
|
||||
private:
|
||||
|
||||
static int constexpr MAX_NEIGHBORS = 10;
|
||||
|
||||
private:
|
||||
|
||||
/** grant full access to the grid */
|
||||
@@ -27,7 +31,7 @@ private:
|
||||
int _idx;
|
||||
|
||||
/** INTERNAL: store neighbors (via index) */
|
||||
int _neighbors[10];
|
||||
int _neighbors[MAX_NEIGHBORS];
|
||||
|
||||
/** INTERNAL: number of neighbors */
|
||||
uint8_t _numNeighbors;
|
||||
@@ -61,7 +65,7 @@ public:
|
||||
int getNumNeighbors() const {return _numNeighbors;}
|
||||
|
||||
/** reached neighbor limit? */
|
||||
bool fullyConnected() const {return _numNeighbors >= 10;}
|
||||
bool fullyConnected() const {return _numNeighbors >= MAX_NEIGHBORS;}
|
||||
|
||||
/** is this node connected to the given index? */
|
||||
bool hasNeighbor(const int idx) const {
|
||||
|
||||
Reference in New Issue
Block a user