|
| colored_grid (unsigned int width=1u, unsigned int length=1u, unsigned int levels=1u) |
| Constructs a colored grid with specified dimensions.
|
|
void | configure (const std::vector< int > &indices) noexcept override |
| Configure the grid's cells' neighbors.
|
|
virtual std::string | contents_of (const std::shared_ptr< cell > &c) const noexcept override |
| Retrieves the contents of a given cell, if available.
|
|
virtual 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.
|
|
| 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.
|
|
grid & | operator= (const grid &other) |
| Assignment operator.
|
|
| grid (grid &&other) noexcept |
| Move constructor.
|
|
grid & | operator= (grid &&other) noexcept |
| Move assignment operator.
|
|
| ~grid () override |
| Destructor.
|
|
std::shared_ptr< cell > | get_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< cell > | get_north (const std::shared_ptr< cell > &c) const noexcept override |
|
std::shared_ptr< cell > | get_south (const std::shared_ptr< cell > &c) const noexcept override |
|
std::shared_ptr< cell > | get_east (const std::shared_ptr< cell > &c) const noexcept override |
|
std::shared_ptr< cell > | get_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< cell > | search (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.
|
|
Extension of the grid class to include color information.