A grid that can calculate distances between cells.
More...
#include <distance_grid.h>
|
| distance_grid (unsigned int width=1u, unsigned int length=1u, unsigned int levels=1u) |
|
virtual std::optional< std::string > | contents_of (const std::shared_ptr< cell > &c) const noexcept override |
| Get detailed information of a cell in the grid.
|
|
virtual std::optional< std::uint32_t > | background_color_for (const std::shared_ptr< cell > &c) const noexcept override |
| Get the background color for a cell in the grid.
|
|
std::shared_ptr< distances > | get_distances () const noexcept |
|
virtual std::future< bool > | get_future () noexcept override |
| Initialize and configure.
|
|
| grid (unsigned int rows=1u, unsigned int columns=1u, unsigned int height=1u) |
| Constructor for grid.
|
|
| grid (std::tuple< unsigned int, unsigned int, unsigned int > dimensions) |
| Constructor for grid.
|
|
| grid (const grid &other) |
| Copy constructor.
|
|
grid & | operator= (const grid &other) |
| Assignment operator.
|
|
| grid (grid &&other) noexcept |
| Move constructor.
|
|
grid & | operator= (grid &&other) noexcept |
| Move assignment operator.
|
|
virtual | ~grid () |
| Destructor.
|
|
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)
|
|
virtual void | to_vec2 (std::vector< std::vector< std::shared_ptr< cell > > > &cells) const noexcept override |
| Convert a 2D grid to a vector of vectors of cells (sorted by row then column)
|
|
std::shared_ptr< cell > | search (int index) const noexcept |
|
int | count () const noexcept |
| Get the count of cells in the grid.
|
|
|
class | binary_tree |
|
class | dfs |
|
class | sidewinder |
|
|
void | build_fut (std::vector< int > const &indices) noexcept |
| Builds a future based on the provided indices.
|
|
void | configure_cells (std::vector< std::shared_ptr< cell > > &cells) const noexcept |
| Configure cells by neighbors (N, S, E, W)
|
|
std::promise< bool > | m_config_promise |
|
std::mutex | m_cells_mutex |
|
std::unordered_map< int, std::shared_ptr< cell > > | m_cells |
|
A grid that can calculate distances between cells.
◆ background_color_for()
virtual std::optional< std::uint32_t > mazes::distance_grid::background_color_for |
( |
const std::shared_ptr< cell > & | c | ) |
const |
|
overridevirtualnoexcept |
◆ contents_of()
virtual std::optional< std::string > mazes::distance_grid::contents_of |
( |
const std::shared_ptr< cell > & | c | ) |
const |
|
overridevirtualnoexcept |
◆ get_future()
virtual std::future< bool > mazes::distance_grid::get_future |
( |
| ) |
|
|
overridevirtualnoexcept |
Initialize and configure.
- Parameters
-
callback | notifies when configuration is complete |
- Returns
Reimplemented from mazes::grid.
The documentation for this class was generated from the following file: