Maze Builder Docs 6.3.5
Loading...
Searching...
No Matches
mazes::grid_interface Class Referenceabstract

Interface for the grid class. More...

#include <grid_interface.h>

Inheritance diagram for mazes::grid_interface:
[legend]

Public Member Functions

virtual std::tuple< unsigned int, unsigned int, unsigned int > get_dimensions () const noexcept=0
 Get dimensions of a grid with no assumptions about the ordering of the dimensions.
 
virtual std::shared_ptr< cellget_north (const std::shared_ptr< cell > &c) const noexcept=0
 
virtual std::shared_ptr< cellget_south (const std::shared_ptr< cell > &c) const noexcept=0
 
virtual std::shared_ptr< cellget_east (const std::shared_ptr< cell > &c) const noexcept=0
 
virtual std::shared_ptr< cellget_west (const std::shared_ptr< cell > &c) const noexcept=0
 
virtual void to_vec (std::vector< std::shared_ptr< cell > > &cells) const noexcept=0
 Transformation and display cells.
 
virtual std::string contents_of (std::shared_ptr< cell > const &c) const noexcept=0
 Get detailed information of a cell in the grid in the form of a string.
 
virtual std::uint32_t background_color_for (std::shared_ptr< cell > const &c) const noexcept=0
 Returns the background color for the specified cell, if available.
 

Friends

std::ostream & operator<< (std::ostream &os, const grid_interface &g)
 Provide a string representation of the grid.
 

Detailed Description

Interface for the grid class.

This interface provides methods to interact with the grid

The grid is configurable

The grid can be visualized as a 2D or 3D structure using strings

The grid can be transformed into a vector of cells or a vector of vectors of cells

The grid can provide detailed information about a cell

Member Function Documentation

◆ background_color_for()

virtual std::uint32_t mazes::grid_interface::background_color_for ( std::shared_ptr< cell > const & c) const
pure virtualnoexcept

Returns the background color for the specified cell, if available.

Parameters
cA shared pointer to the cell for which to determine the background color.
Returns
An optional 32-bit unsigned integer representing the background color of the cell, or 0x00 otherwise

Implemented in mazes::colored_grid, mazes::distance_grid, and mazes::grid.

◆ contents_of()

virtual std::string mazes::grid_interface::contents_of ( std::shared_ptr< cell > const & c) const
pure virtualnoexcept

Get detailed information of a cell in the grid in the form of a string.

Parameters
c
Returns

Implemented in mazes::colored_grid, mazes::distance_grid, and mazes::grid.

◆ get_dimensions()

virtual std::tuple< unsigned int, unsigned int, unsigned int > mazes::grid_interface::get_dimensions ( ) const
pure virtualnoexcept

Get dimensions of a grid with no assumptions about the ordering of the dimensions.

Implemented in mazes::grid.

◆ to_vec()

virtual void mazes::grid_interface::to_vec ( std::vector< std::shared_ptr< cell > > & cells) const
pure virtualnoexcept

Transformation and display cells.

Implemented in mazes::grid.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const grid_interface & g )
friend

Provide a string representation of the grid.

Parameters
os
g
Returns


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