MiniGame-Madness
Public Member Functions | Public Attributes | List of all members
MazeNode Struct Reference

A struct that reprsents 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 nodes with a direction. More...
 
bool removeNeighbor (Direction direction)
 Remove a neighboring node with a direction. More...
 
MazeNodegetNeighbor (Direction direction) const
 Get the neighboring node in a given direction. More...
 
std::map< Direction, MazeNode * > getNeighbors () const
 Get all neighboring nodes. More...
 
NodeType getNodeType () const
 Get the piece type of the node. More...
 
bool setNodeType (NodeType type)
 Set the piece type of the node. More...
 

Public Attributes

NodeType type
 
std::map< Direction, MazeNode * > neighbors
 

Detailed Description

A struct that reprsents the nodes in the graph of the maze.

The default type is None reprasenting a node that hasn't been assigned a type yet.

Constructor & Destructor Documentation

◆ MazeNode()

MazeNode::MazeNode ( )
inline

Default constructor for MazeNode.

Initialize the MazeNode the type NONE

Member Function Documentation

◆ addNeighbor()

void MazeNode::addNeighbor ( MazeNode node,
Direction  direction 
)
inline

Add a neighboring nodes with a direction.

Parameters
node- The node to add as a neighbor.
direction- The direction of the neighboring node.

◆ getNeighbor()

MazeNode* MazeNode::getNeighbor ( Direction  direction) const
inline

Get the neighboring node in a given direction.

Parameters
direction- The direction of the neighboring node.
Returns
The neighboring node in the given direction.

◆ getNeighbors()

std::map<Direction, MazeNode*> MazeNode::getNeighbors ( ) const
inline

Get all neighboring nodes.

Returns
A map of directions to neighboring nodes.

◆ getNodeType()

NodeType MazeNode::getNodeType ( ) const
inline

Get the piece type of the node.

Returns
The piece type of the node.

◆ removeNeighbor()

bool MazeNode::removeNeighbor ( Direction  direction)
inline

Remove a neighboring node with a direction.

Parameters
direction- The direction of the neighboring node.

◆ setNodeType()

bool MazeNode::setNodeType ( NodeType  type)
inline

Set the piece type of the node.

Parameters
type- The piece type to set.
Returns
True if the piece type was set successfully, false otherwise.

Member Data Documentation

◆ neighbors

std::map<Direction, MazeNode*> MazeNode::neighbors

A map of directions to neighboring nodes.

◆ type

NodeType MazeNode::type

The type of the node


The documentation for this struct was generated from the following file: