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:
2016-09-10 15:12:39 +02:00
parent 7baeecb3f9
commit 82f8828a04
26 changed files with 996 additions and 198 deletions

View File

@@ -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 {