Maze Builder Docs 7.5.6
Loading...
Searching...
No Matches
colored_grid.h
1#ifndef COLORED_GRID_H
2#define COLORED_GRID_H
3
5
6namespace mazes
7{
8
9 class cell;
10 class distances;
11 class grid_operations;
12
14 {
15
16 public:
17 // Delete copy constructor and copy assignment operator to fix the static assertion failure
18 colored_grid(const colored_grid &) = delete;
19 colored_grid &operator=(const colored_grid &) = delete;
20
21 // Explicitly define move constructor and move assignment operator
22 colored_grid(colored_grid &&) noexcept = default;
23 colored_grid &operator=(colored_grid &&) noexcept = default;
24
29 explicit colored_grid(unsigned int width = 1u, unsigned int length = 1u, unsigned int levels = 1u);
30
34 virtual std::string contents_of(const std::shared_ptr<cell> &c) const noexcept override;
35
39 virtual std::uint32_t background_color_for(const std::shared_ptr<cell> &c) const noexcept override;
40
41 // Delegate to embedded grid
42 grid_operations &operations() noexcept override;
43
44 const grid_operations &operations() const noexcept override;
45
46 private:
47 std::shared_ptr<distances> m_distances;
48
49 // Change from grid_interface to grid since we need grid's implementation of operations()
50 std::unique_ptr<grid_interface> m_grid;
51 };
52
53} // namespace mazes
54
55#endif // COLORED_GRID_H
Definition colored_grid.h:14
grid_operations & operations() noexcept override
Get access to grid operations interface.
virtual std::uint32_t background_color_for(const std::shared_ptr< cell > &c) const noexcept override
Retrieves the background color for a given cell, if available.
colored_grid(unsigned int width=1u, unsigned int length=1u, unsigned int levels=1u)
Constructs a colored grid with specified dimensions.
virtual std::string contents_of(const std::shared_ptr< cell > &c) const noexcept override
Retrieves the contents of a given cell, if available.
A class that manages distances associated with cells in a grid.
Definition distances.h:19
Interface for the grid class.
Definition grid_interface.h:20
Interface for grid navigation and manipulation operations.
Definition grid_operations.h:18
Namespace for the maze builder.
Definition algo_interface.h:6