Classes |
Public Types |
Public Member Functions |
Static Private Member Functions |
List of all members
huc::maze::DFSGenerator Class Reference
#include <dfs_generator.hxx>
Classes | |
struct | CellInfo |
Public Types | |
typedef Grid< CellInfo > | Maze |
typedef Maze::Cell | Cell |
typedef Maze::Point | Point |
Public Member Functions | |
std::unique_ptr< Maze > | operator() (const uint32_t width, const uint32_t height, const Point &startPoint=Point(0, 0), const uint32_t seed=0) |
Static Private Member Functions | |
static std::vector< std::shared_ptr< Cell > > | GetNeighbours (const Maze &maze, const Cell &cell) |
Detailed Description
Depth First Search Generator - Generate a maze using a Depth First Search (DFS) strategy.
Depth First Search (DFS) Maze Generator is a randomized version of the depth-first search traversal algorithm. Implemented with a stack, this approach is one of the simplest ways to generate a maze.
- Parameters
-
width desired width for the maze. height desired height for the maze. startPoint possible point to start the algorithm, {x: 0, y: 0} by default. seed number used to initiate the random generator, 0 by default.
- Returns
- Operator() returns Maze Grid pointer to be owned, nullptr if construction failed.
Definition at line 45 of file dfs_generator.hxx.
Member Typedef Documentation
Definition at line 52 of file dfs_generator.hxx.
typedef Grid<CellInfo> huc::maze::DFSGenerator::Maze |
Definition at line 51 of file dfs_generator.hxx.
Definition at line 53 of file dfs_generator.hxx.
Member Function Documentation
|
inlinestaticprivate |
GetNeighbours - Retrieve available neighbours
- Parameters
-
maze Grid within the search occurs cell Cell of which neighbours will be found.
- Returns
- vector of neighbours that has not been visited yet, empty vector if none.
Definition at line 112 of file dfs_generator.hxx.
|
inline |
Definition at line 55 of file dfs_generator.hxx.
static std::vector< std::shared_ptr< Cell > > GetNeighbours(const Maze &maze, const Cell &cell)
Definition: dfs_generator.hxx:112
The documentation for this class was generated from the following file: