6#include <unordered_map>
19 explicit cell(std::int32_t index = 0);
25 void link(std::shared_ptr<cell> c1, std::shared_ptr<cell> c2,
bool bidi=
true);
31 void unlink(std::shared_ptr<cell> c1, std::shared_ptr<cell> c2,
bool bidi=
true);
36 const std::unordered_map<std::shared_ptr<cell>,
bool>&
get_links();
103 bool has_key(const std::shared_ptr<
cell>& c);
105 std::unordered_map<std::shared_ptr<
cell>,
bool> m_links;
107 std::int32_t m_index;
109 std::shared_ptr<
cell> m_north;
110 std::shared_ptr<
cell> m_south;
111 std::shared_ptr<
cell> m_east;
112 std::shared_ptr<
cell> m_west;
Cell class for maze generation.
Definition cell.h:14
const std::unordered_map< std::shared_ptr< cell >, bool > & get_links()
Retrieves a constant reference to an unordered map of cell links and their boolean states.
std::shared_ptr< cell > get_south() const
Retrieves a shared pointer to the cell located to the south.
bool has_western_neighbor() const noexcept
Checks if there is a western neighbor.
std::shared_ptr< cell > get_north() const
Retrieves a shared pointer to the cell located to the north.
void link(std::shared_ptr< cell > c1, std::shared_ptr< cell > c2, bool bidi=true)
Links two cell objects, optionally in both directions.
bool has_southern_neighbor() const noexcept
Checks if the current object has a southern neighbor.
void unlink(std::shared_ptr< cell > c1, std::shared_ptr< cell > c2, bool bidi=true)
Unlinks two cells, optionally in both directions.
bool has_eastern_neighbor() const noexcept
Checks if there is an eastern neighbor.
cell(std::int32_t index=0)
Constructs a cell object with an optional index.
void set_index(std::int32_t next_index) noexcept
Sets the index to the specified value.
int32_t get_index() const noexcept
Retrieves the index of the current cell.
bool has_northern_neighbor() const noexcept
Checks if the current object has a northern neighbor.
std::shared_ptr< cell > get_west() const
Retrieves a shared pointer to the cell located to the west.
void set_south(std::shared_ptr< cell > const &other)
Sets the southern neighbor of the current cell.
void set_east(std::shared_ptr< cell > const &other)
Sets the east neighbor of the current cell.
bool is_linked(const std::shared_ptr< cell > &c)
Checks if a cell is linked.
std::shared_ptr< cell > get_east() const
Retrieves a shared pointer to the cell located to the east.
void set_north(std::shared_ptr< cell > const &other)
Sets the northern neighbor of the current cell.
std::vector< std::shared_ptr< cell > > get_neighbors() const noexcept
Retrieves a list of neighboring cells.
void set_west(std::shared_ptr< cell > const &other)
Sets the west neighbor of the current cell.
Namespace for the maze builder.
Definition algo_interface.h:9