Maze Builder Docs 8.10.23
Loading...
Searching...
No Matches
lab.h
Go to the documentation of this file.
1#ifndef LAB_H
2#define LAB_H
3
4#include <functional>
5#include <memory>
6
9namespace mazes
10{
11 class cell;
12 class grid_operations;
13 class randomizer;
14
18 class lab
19 {
20 public:
25 static void link(const std::shared_ptr<cell>& c1, const std::shared_ptr<cell>& c2, bool bidi = true) noexcept;
26
31 static void unlink(const std::shared_ptr<cell>& c1, const std::shared_ptr<cell>& c2, bool bidi = true) noexcept;
32
34 using cell_filter = std::function<bool(int)>;
35
40 static bool binary_tree(grid_operations &ops, randomizer &rng, const cell_filter &open = {});
41 static bool sidewinder(grid_operations &ops, randomizer &rng, const cell_filter &open = {});
42 static bool dfs(grid_operations &ops, randomizer &rng, const cell_filter &open = {});
43 static bool prims(grid_operations &ops, randomizer &rng, const cell_filter &open = {});
44 }; // class lab
45}
46
47#endif // LAB_H
Cell class with links to other cells.
Definition cell.h:18
Interface for grid navigation and manipulation operations.
Definition grid_operations.h:22
Provides link operations and maze algorithms.
Definition lab.h:19
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.
std::function< bool(int)> cell_filter
Accepts or rejects a cell by its grid index.
Definition lab.h:34
static bool binary_tree(grid_operations &ops, randomizer &rng, const cell_filter &open={})
Maze algorithms sized from ops.get_dimensions().
Provides random-number generating capabilities.
Definition randomizer.h:16