MiniGame-Madness
|
A struct that represents the nodes in the graph of the maze. More...
#include <maze.h>
Public Member Functions | |
MazeNode () | |
Default constructor for MazeNode. More... | |
void | addNeighbor (MazeNode *node, Direction direction) |
Add a neighboring node with a direction. More... | |
void | removeNeighbor (Direction direction) |
Remove a neighboring node based on a direction. More... | |
MazeNode * | getNeighbor (Direction direction) const |
Get the neighboring node in a given direction. More... | |
std::map< Direction, MazeNode * > | getNeighbors () const |
Get all neighboring nodes. More... | |
Public Attributes | |
std::map< Direction, MazeNode * > | neighbors |
A struct that represents the nodes in the graph of the maze.
The default is each neighbor is set to nullptr.
|
inline |
Add a neighboring node with a direction.
node | - The node to add as a neighbor. |
direction | - The direction of the neighboring node. |
runtime_error | if the neighbor already exists in the given direction. |
Get the neighboring node in a given direction.
direction | - The direction of the neighboring node. |
Get all neighboring nodes.
|
inline |
Remove a neighboring node based on a direction.
direction | - The direction of the neighboring node. |
runtime_error | if the neighbor is not found in the given direction. |
A map of directions to neighboring nodes, using raw pointers since neighbors don't own each other.