Maze Builder Docs 6.7.5
Loading...
Searching...
No Matches
colored_grid.h
1#ifndef COLORED_GRID_H
2#define COLORED_GRID_H
3
5
6namespace mazes {
7
8class cell;
9class distances;
10class grid_operations;
11
13
14public:
15
16 // Delete copy constructor and copy assignment operator to fix the static assertion failure
17 colored_grid(const colored_grid&) = delete;
18 colored_grid& operator=(const colored_grid&) = delete;
19
20 // Explicitly define move constructor and move assignment operator
21 colored_grid(colored_grid&&) noexcept = default;
22 colored_grid& operator=(colored_grid&&) noexcept = default;
23
28 explicit colored_grid(unsigned int width = 1u, unsigned int length = 1u, unsigned int levels = 1u);
29
33 virtual std::string contents_of(const std::shared_ptr<cell>& c) const noexcept override;
34
38 virtual std::uint32_t background_color_for(const std::shared_ptr<cell>& c) const noexcept override;
39
40 // Delegate to embedded grid
41 grid_operations& operations() noexcept override;
42
43 const grid_operations& operations() const noexcept override;
44
45private:
46 std::shared_ptr<distances> m_distances;
47
48 // Change from grid_interface to grid since we need grid's implementation of operations()
49 std::unique_ptr<grid_interface> m_grid;
50};
51
52} // namespace mazes
53
54#endif // COLORED_GRID_H
Definition colored_grid.h:12
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:17
Interface for the grid class.
Definition grid_interface.h:18
Interface for grid navigation and manipulation operations.
Definition grid_operations.h:16
Namespace for the maze builder.
Definition algo_interface.h:9