Maze Builder Docs 8.10.23
Loading...
Searching...
No Matches
mazes::colored_grid Class Reference

A colored grid implementation that extends the grid_interface to include distance-based coloring. More...

#include <colored_grid.h>

Inheritance diagram for mazes::colored_grid:
[legend]
Collaboration diagram for mazes::colored_grid:
[legend]

Public Member Functions

 colored_grid (unsigned int width=1u, unsigned int length=1u, unsigned int levels=1u)
 Constructs a colored grid with specified dimensions.
 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
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.
Public Member Functions inherited from mazes::grid_interface
virtual ~grid_interface ()=default
 Virtual destructor for the grid_interface class.

Detailed Description

A colored grid implementation that extends the grid_interface to include distance-based coloring.

Constructor & Destructor Documentation

◆ 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
widthNumber of rows
lengthNumber of columns
levelsNumber of levels

Member Function Documentation

◆ 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
cA 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
cA 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_indexThe index of the starting cell for distance calculation.
goal_indexThe index of the goal cell for distance calculation.

◆ operations() [1/2]

const grid_operations & mazes::colored_grid::operations ( ) const
nodiscardoverridevirtualnoexcept

Get access to const grid operations interface.

Returns
A const reference to the grid operations interface

Implements mazes::grid_interface.

◆ operations() [2/2]

grid_operations & mazes::colored_grid::operations ( )
nodiscardoverridevirtualnoexcept

Get access to grid operations interface.

Returns
A reference to the grid operations interface

Implements mazes::grid_interface.


The documentation for this class was generated from the following file: