Maze Builder Docs 6.3.5
Loading...
Searching...
No Matches
mazes::distance_grid Class Reference

A grid that can calculate distances between cells. More...

#include <distance_grid.h>

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

Public Member Functions

 distance_grid (unsigned int width=1u, unsigned int length=1u, unsigned int levels=1u)
 
void configure (const std::vector< int > &indices) noexcept override
 
virtual std::string contents_of (std::shared_ptr< cell > const &c) const noexcept override
 
virtual std::uint32_t background_color_for (std::shared_ptr< cell > const &c) const noexcept override
 
void calculate_distances (int start_index, int end_index) noexcept
 Calculates distances for a range of indices.
 
std::shared_ptr< distancesget_distances () const noexcept
 
- Public Member Functions inherited from mazes::grid
 grid (unsigned int r=1u, unsigned int c=1u, unsigned int l=1u)
 
 grid (std::tuple< unsigned int, unsigned int, unsigned int > dimens)
 
 grid (const grid &other)
 Copy constructor.
 
gridoperator= (const grid &other)
 Assignment operator.
 
 grid (grid &&other) noexcept
 Move constructor.
 
gridoperator= (grid &&other) noexcept
 Move assignment operator.
 
 ~grid () override
 Destructor.
 
std::shared_ptr< cellget_neighbor (std::shared_ptr< cell > const &c, Direction dir) const noexcept
 Get neighbor by the cell's respective location.
 
std::vector< std::shared_ptr< cell > > get_neighbors (std::shared_ptr< cell > const &c) const noexcept
 Get all the neighbors by the cell.
 
void set_neighbor (const std::shared_ptr< cell > &c, Direction dir, std::shared_ptr< cell > const &neighbor) noexcept
 
std::shared_ptr< cellget_north (const std::shared_ptr< cell > &c) const noexcept override
 
std::shared_ptr< cellget_south (const std::shared_ptr< cell > &c) const noexcept override
 
std::shared_ptr< cellget_east (const std::shared_ptr< cell > &c) const noexcept override
 
std::shared_ptr< cellget_west (const std::shared_ptr< cell > &c) const noexcept override
 
virtual std::tuple< unsigned int, unsigned int, unsigned int > get_dimensions () const noexcept override
 Provides dimensions of grid in no assumed ordering.
 
virtual void to_vec (std::vector< std::shared_ptr< cell > > &cells) const noexcept override
 Convert a 2D grid to a vector of cells (sorted by row then column)
 
std::shared_ptr< cellsearch (int index) const noexcept
 
int num_cells () const noexcept
 Get the count of cells in the grid.
 
void clear_cells () noexcept
 Cleanup cells by cleaning up links within cells.
 
- Public Member Functions inherited from mazes::grid_interface

Friends

class binary_tree
 
class dfs
 
class sidewinder
 

Detailed Description

A grid that can calculate distances between cells.

Member Function Documentation

◆ background_color_for()

virtual std::uint32_t mazes::distance_grid::background_color_for ( std::shared_ptr< cell > const & c) const
overridevirtualnoexcept
Parameters
c
Returns

Reimplemented from mazes::grid.

◆ calculate_distances()

void mazes::distance_grid::calculate_distances ( int start_index,
int end_index )
noexcept

Calculates distances for a range of indices.

Parameters
start_indexThe starting index of the range (inclusive).
end_indexThe ending index of the range (exclusive).

◆ configure()

void mazes::distance_grid::configure ( const std::vector< int > & indices)
overridevirtualnoexcept
Parameters
indices
Returns

Reimplemented from mazes::grid.

◆ contents_of()

virtual std::string mazes::distance_grid::contents_of ( std::shared_ptr< cell > const & c) const
overridevirtualnoexcept
Parameters
c
Returns

Reimplemented from mazes::grid.


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