Maze Builder Docs 6.0.1
Loading...
Searching...
No Matches
distance_grid.h
Go to the documentation of this file.
1#ifndef DISTANCE_GRID_H
2#define DISTANCE_GRID_H
3
4#include <future>
5#include <memory>
6#include <string>
7#include <unordered_map>
8
9#include <MazeBuilder/grid.h>
10
11namespace mazes {
12
13class distances;
14class cell;
15
19class distance_grid : public grid {
20public:
21 friend class binary_tree;
22 friend class dfs;
23 friend class sidewinder;
24
25 explicit distance_grid(unsigned int width = 1u, unsigned int length = 1u, unsigned int levels = 1u);
26
27 virtual std::optional<std::string> contents_of(const std::shared_ptr<cell>& c) const noexcept override;
28 virtual std::optional<std::uint32_t> background_color_for(const std::shared_ptr<cell>& c) const noexcept override;
29
30 std::shared_ptr<distances> get_distances() const noexcept;
31
32 virtual std::future<bool> get_future() noexcept override;
33private:
34 std::shared_ptr<distances> m_distances;
35
36 std::optional<std::string> to_base36(int value) const;
37};
38}
39
40#endif // DISTANCE_GRID_H
Binary tree algorithm for generating mazes.
Definition binary_tree.h:18
Depth-first search algorithm for generating mazes.
Definition dfs.h:19
A grid that can calculate distances between cells.
Definition distance_grid.h:19
virtual std::optional< std::uint32_t > background_color_for(const std::shared_ptr< cell > &c) const noexcept override
Get the background color for a cell in the grid.
virtual std::future< bool > get_future() noexcept override
Initialize and configure.
virtual std::optional< std::string > contents_of(const std::shared_ptr< cell > &c) const noexcept override
Get detailed information of a cell in the grid.
Distances utility class for counting paths and nodes.
Definition distances.h:17
General purpose grid class for maze generation.
Definition grid.h:21
Sidewinder algorithm for generating mazes.
Definition sidewinder.h:17
Namespace for the maze builder.
Definition algo_interface.h:9