A colored grid implementation that extends the grid_interface to include distance-based coloring.
More...
#include <colored_grid.h>
|
|
| colored_grid (const colored_grid &)=delete |
| |
|
colored_grid & | operator= (const colored_grid &)=delete |
| |
|
| colored_grid (colored_grid &&) noexcept=default |
| |
|
colored_grid & | operator= (colored_grid &&) noexcept=default |
| |
| | colored_grid (unsigned int width=1u, unsigned int length=1u, unsigned int levels=1u) |
| | Constructs a colored grid with specified dimensions.
|
| |
| std::string | contents_of (const std::shared_ptr< cell > &c) const noexcept override |
| | Retrieves the contents of a given cell, if available.
|
| |
| 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.
|
| |
| void | initialize_distance_coloring (int start_index, int goal_index) noexcept |
| | Initialize distance coloring from a starting cell index.
|
| |
| grid_operations & | operations () noexcept override |
| | Get access to grid operations interface.
|
| |
| const grid_operations & | operations () const noexcept override |
| | Get access to const grid operations interface.
|
| |
| void | resize (unsigned int rows, unsigned int cols, unsigned int levels) const noexcept |
| | Resize the grid to the specified dimensions.
|
| |
|
virtual | ~grid_interface ()=default |
| | Virtual destructor for the grid_interface class.
|
| |
A colored grid implementation that extends the grid_interface to include distance-based coloring.
◆ colored_grid()
| mazes::colored_grid::colored_grid |
( |
unsigned int | width = 1u, |
|
|
unsigned int | length = 1u, |
|
|
unsigned int | levels = 1u ) |
|
explicit |
Constructs a colored grid with specified dimensions.
- Parameters
-
| width | The width of the grid. Defaults to 1. |
| length | The length of the grid. Defaults to 1. |
| levels | The number of levels in the grid. Defaults to 1. |
◆ background_color_for()
| std::uint32_t mazes::colored_grid::background_color_for |
( |
const std::shared_ptr< cell > & | c | ) |
const |
|
nodiscardoverridevirtualnoexcept |
Retrieves the background color for a given cell, if available.
- Parameters
-
| c | A shared pointer to the cell for which the background color is to be retrieved. |
- Returns
- An 32-bit unsigned integer containing the background color
Implements mazes::grid_interface.
◆ contents_of()
| std::string mazes::colored_grid::contents_of |
( |
const std::shared_ptr< cell > & | c | ) |
const |
|
nodiscardoverridevirtualnoexcept |
Retrieves the contents of a given cell, if available.
- Parameters
-
| c | A shared pointer to the cell whose contents are to be retrieved. |
- Returns
- If the cell has no contents, the contents are considered empty
Implements mazes::grid_interface.
◆ initialize_distance_coloring()
| void mazes::colored_grid::initialize_distance_coloring |
( |
int | start_index, |
|
|
int | goal_index ) |
|
noexcept |
Initialize distance coloring from a starting cell index.
- Parameters
-
| start_index | The index of the starting cell for distance calculation. |
| goal_index | The index of the goal cell for distance calculation. |
◆ operations() [1/2]
|
|
nodiscardoverridevirtualnoexcept |
Get access to const grid operations interface.
- Returns
- A const reference to the grid operations interface
Implements mazes::grid_interface.
◆ operations() [2/2]
|
|
nodiscardoverridevirtualnoexcept |
Get access to grid operations interface.
- Returns
- A reference to the grid operations interface
Implements mazes::grid_interface.
◆ resize()
| void mazes::colored_grid::resize |
( |
unsigned int | rows, |
|
|
unsigned int | cols, |
|
|
unsigned int | levels ) const |
|
noexcept |
Resize the grid to the specified dimensions.
- Parameters
-
The documentation for this class was generated from the following file: