Provides link operations and maze algorithms.
More...
|
|
using | cell_filter = std::function<bool(int)> |
| | Accepts or rejects a cell by its grid index.
|
|
| static void | link (const std::shared_ptr< cell > &c1, const std::shared_ptr< cell > &c2, bool bidi=true) noexcept |
| | Links two cell objects, optionally in both directions.
|
| static void | unlink (const std::shared_ptr< cell > &c1, const std::shared_ptr< cell > &c2, bool bidi=true) noexcept |
| | Unlinks two cell objects, optionally in both directions.
|
| static bool | binary_tree (grid_operations &ops, randomizer &rng, const cell_filter &open={}) |
| | Maze algorithms sized from ops.get_dimensions().
|
|
static bool | sidewinder (grid_operations &ops, randomizer &rng, const cell_filter &open={}) |
|
static bool | dfs (grid_operations &ops, randomizer &rng, const cell_filter &open={}) |
|
static bool | prims (grid_operations &ops, randomizer &rng, const cell_filter &open={}) |
Provides link operations and maze algorithms.
"labyrinth"
Links and unlinks cells, and carves mazes into any grid_operations implementation.
◆ binary_tree()
Maze algorithms sized from ops.get_dimensions().
An optional cell_filter restricts the maze to cells whose index it accepts (e.g. to honor a mask); an empty filter accepts every cell.
- Returns
- False if the grid has no accepted cell to work on
◆ link()
| void mazes::lab::link |
( |
const std::shared_ptr< cell > & | c1, |
|
|
const std::shared_ptr< cell > & | c2, |
|
|
bool | bidi = true ) |
|
staticnoexcept |
Links two cell objects, optionally in both directions.
- Parameters
-
| c1 | A shared pointer to the first cell object. |
| c2 | A shared pointer to the second cell object. |
| bidi | A boolean flag indicating if the link should be bidirectional. Defaults to true. |
◆ unlink()
| void mazes::lab::unlink |
( |
const std::shared_ptr< cell > & | c1, |
|
|
const std::shared_ptr< cell > & | c2, |
|
|
bool | bidi = true ) |
|
staticnoexcept |
Unlinks two cell objects, optionally in both directions.
- Parameters
-
| c1 | A shared pointer to the first cell object. |
| c2 | A shared pointer to the second cell object. |
| bidi | A boolean flag indicating if the unlink should be bidirectional. Defaults to true. |
The documentation for this class was generated from the following file: