Cell class for maze generation - only stores its index and links to other cells.
More...
#include <cell.h>
|
| cell (std::int32_t index=0) |
| Constructs a cell object with an optional index.
|
|
| cell (const cell &other) |
|
cell & | operator= (const cell &other) |
|
| cell (cell &&other) noexcept |
|
cell & | operator= (cell &&other) noexcept |
|
void | add_link (const std::shared_ptr< cell > &other) |
| Add a link to another cell (passage between cells)
|
|
void | remove_link (const std::shared_ptr< cell > &other) |
| Remove a link to another cell.
|
|
std::vector< std::pair< std::shared_ptr< cell >, bool > > | get_links () const |
| Retrieves links to other cells.
|
|
bool | is_linked (const std::shared_ptr< cell > &c) |
| Checks if a cell is linked.
|
|
int32_t | get_index () const noexcept |
| Retrieves the index of the current cell.
|
|
void | set_index (std::int32_t next_index) noexcept |
| Sets the index to the specified value.
|
|
void | cleanup_links () |
| Cleans up or removes links, typically as part of a resource management or shutdown process.
|
|
Cell class for maze generation - only stores its index and links to other cells.
◆ cell()
mazes::cell::cell |
( |
std::int32_t | index = 0 | ) |
|
|
explicit |
Constructs a cell object with an optional index.
- Parameters
-
index | The index to initialize the cell with. Defaults to 0. |
◆ add_link()
void mazes::cell::add_link |
( |
const std::shared_ptr< cell > & | other | ) |
|
Add a link to another cell (passage between cells)
- Parameters
-
◆ get_index()
int32_t mazes::cell::get_index |
( |
| ) |
const |
|
noexcept |
Retrieves the index of the current cell.
- Returns
- The index of the current cell.
◆ get_links()
std::vector< std::pair< std::shared_ptr< cell >, bool > > mazes::cell::get_links |
( |
| ) |
const |
Retrieves links to other cells.
- Returns
- A vector of pairs containing linked cells and their link status
◆ is_linked()
bool mazes::cell::is_linked |
( |
const std::shared_ptr< cell > & | c | ) |
|
Checks if a cell is linked.
- Parameters
-
c | A shared pointer to the cell to check. |
- Returns
- True if the cell is linked, false otherwise.
◆ remove_link()
void mazes::cell::remove_link |
( |
const std::shared_ptr< cell > & | other | ) |
|
Remove a link to another cell.
- Parameters
-
other | The cell to unlink from |
◆ set_index()
void mazes::cell::set_index |
( |
std::int32_t | next_index | ) |
|
|
noexcept |
Sets the index to the specified value.
- Parameters
-
next_index | The new index value to set. |
The documentation for this class was generated from the following file: