6#include <unordered_map>
37 void set(int32_t index,
int distance)
noexcept;
47 std::shared_ptr<distances>
path_to(std::unique_ptr<grid_interface>
const& g, int32_t goal_index)
const noexcept;
51 std::pair<int32_t, int>
max() const noexcept;
59 std::unordered_map<int32_t,
int> m_cells;
A class that manages distances associated with cells in a grid.
Definition distances.h:17
void set(int32_t index, int distance) noexcept
Sets the distance of a cell by index.
std::pair< int32_t, int > max() const noexcept
Computes the maximum distance and cell index in a distances object.
distances(int32_t root_index)
Constructor that initializes the distances object with a given root index.
int & operator[](int32_t index) noexcept
Overloaded operator to access the distance of a cell by index.
std::shared_ptr< distances > path_to(std::unique_ptr< grid_interface > const &g, int32_t goal_index) const noexcept
Computes the shortest path to a goal cell index within a distances object.
bool contains(int32_t index) const noexcept
Checks if a given cell index is contained in the distances object.
const int & operator[](int32_t index) const noexcept
Accesses the value associated with a given cell index.
void collect_keys(std::vector< int32_t > &indices) const noexcept
Collects all cell indices stored in the distances object.
Namespace for the maze builder.
Definition algo_interface.h:9