Maze Builder Docs 6.7.5
Loading...
Searching...
No Matches
mazes::grid_operations Class Referenceabstract

Interface for grid navigation and manipulation operations. More...

#include <grid_operations.h>

Inheritance diagram for mazes::grid_operations:
[legend]

Public Member Functions

virtual ~grid_operations ()=default
 Destroys the grid_operations object and releases any associated resources.
 
virtual std::tuple< unsigned int, unsigned int, unsigned int > get_dimensions () const noexcept=0
 Retrieves the dimensions as a tuple of three unsigned integers.
 
virtual std::shared_ptr< cellget_neighbor (std::shared_ptr< cell > const &c, Direction dir) const noexcept=0
 Get neighbor by the cell's respective location.
 
virtual std::vector< std::shared_ptr< cell > > get_neighbors (std::shared_ptr< cell > const &c) const noexcept=0
 Get all the neighbors by the cell.
 
virtual void set_neighbor (const std::shared_ptr< cell > &c, Direction dir, std::shared_ptr< cell > const &neighbor) noexcept=0
 Set neighbor for a cell in a given direction.
 
virtual void sort (std::vector< std::shared_ptr< cell > > &cells) const noexcept=0
 Transformation and display cells.
 
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 std::shared_ptr< cellsearch (int index) const noexcept=0
 Search for a cell by index.
 
virtual std::vector< std::shared_ptr< cell > > get_cells () const noexcept=0
 Retrieves a collection of cell objects.
 
virtual int num_cells () const noexcept=0
 Get the count of cells in the grid.
 
virtual void clear_cells () noexcept=0
 Cleanup cells by cleaning up links within cells.
 
virtual bool set_cells (const std::vector< std::shared_ptr< cell > > &cells) noexcept=0
 Set the cells in the grid.
 
virtual void set_str (std::string const &str) noexcept=0
 
virtual std::string get_str () const noexcept=0
 

Detailed Description

Interface for grid navigation and manipulation operations.

Member Function Documentation

◆ clear_cells()

virtual void mazes::grid_operations::clear_cells ( )
pure virtualnoexcept

Cleanup cells by cleaning up links within cells.

Implemented in mazes::grid.

◆ get_cells()

virtual std::vector< std::shared_ptr< cell > > mazes::grid_operations::get_cells ( ) const
pure virtualnoexcept

Retrieves a collection of cell objects.

Returns
A vector containing shared pointers to cell objects.

Implemented in mazes::grid.

◆ get_dimensions()

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

Retrieves the dimensions as a tuple of three unsigned integers.

Returns
A tuple containing three unsigned integers representing the dimensions.

Implemented in mazes::grid.

◆ get_neighbor()

virtual std::shared_ptr< cell > mazes::grid_operations::get_neighbor ( std::shared_ptr< cell > const & c,
Direction dir ) const
pure virtualnoexcept

Get neighbor by the cell's respective location.

Parameters
c
dir
Returns

Implemented in mazes::grid.

◆ get_neighbors()

virtual std::vector< std::shared_ptr< cell > > mazes::grid_operations::get_neighbors ( std::shared_ptr< cell > const & c) const
pure virtualnoexcept

Get all the neighbors by the cell.

Parameters
c
Returns

Implemented in mazes::grid.

◆ num_cells()

virtual int mazes::grid_operations::num_cells ( ) const
pure virtualnoexcept

Get the count of cells in the grid.

Returns
The number of cells in the grid

Implemented in mazes::grid.

◆ search()

virtual std::shared_ptr< cell > mazes::grid_operations::search ( int index) const
pure virtualnoexcept

Search for a cell by index.

Parameters
index
Returns

Implemented in mazes::grid.

◆ set_cells()

virtual bool mazes::grid_operations::set_cells ( const std::vector< std::shared_ptr< cell > > & cells)
pure virtualnoexcept

Set the cells in the grid.

Parameters
cellsVector of cells to set
Returns
True if the cells were successfully set, false otherwise

Implemented in mazes::grid.

◆ set_neighbor()

virtual void mazes::grid_operations::set_neighbor ( const std::shared_ptr< cell > & c,
Direction dir,
std::shared_ptr< cell > const & neighbor )
pure virtualnoexcept

Set neighbor for a cell in a given direction.

Parameters
c
dir
neighbor
Returns

Implemented in mazes::grid.

◆ sort()

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

Transformation and display cells.

Parameters
cellsVector to fill with cells

Implemented in mazes::grid.


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