4 #include "RehtiReader.hpp"
26 std::shared_ptr<Node>
parent =
nullptr;
43 bool isValidCell(
const std::vector<std::vector<uint8_t>>& map, std::pair<int, int> cell,
Direction dir);
52 unsigned int euclideanDistance(std::pair<int, int> start, std::pair<int, int> end);
62 std::vector<std::pair<int, int>>
astar(
const std::vector<std::vector<uint8_t>>& map, std::pair<int, int> start, std::pair<int, int> end);
Direction
Definition: server/src/world/Utils.hpp:10
@ SOUTH
Definition: server/src/world/Utils.hpp:15
@ SOUTH_WEST
Definition: server/src/world/Utils.hpp:16
@ EAST
Definition: server/src/world/Utils.hpp:13
@ NORTH_WEST
Definition: server/src/world/Utils.hpp:18
@ NORTH
Definition: server/src/world/Utils.hpp:11
@ NORTH_EAST
Definition: server/src/world/Utils.hpp:12
@ SOUTH_EAST
Definition: server/src/world/Utils.hpp:14
@ WEST
Definition: server/src/world/Utils.hpp:17
unsigned int euclideanDistance(std::pair< int, int > start, std::pair< int, int > end)
Calculate the euclidean distance between two points.
Definition: server/src/world/Utils.cpp:42
bool isValidCell(const std::vector< std::vector< uint8_t >> &map, std::pair< int, int > cell, Direction dir)
Check if cell is valid and accessible from given direction.
Definition: server/src/world/Utils.cpp:10
std::vector< std::pair< int, int > > astar(const std::vector< std::vector< uint8_t >> &map, std::pair< int, int > start, std::pair< int, int > end)
A-star algorithm made to work with the access map format. Allows diagonal movement and has a heuristi...
Definition: server/src/world/Utils.cpp:57
Definition: server/src/world/Utils.hpp:22
std::shared_ptr< Node > parent
Definition: server/src/world/Utils.hpp:26
float totalCost()
Definition: server/src/world/Utils.hpp:29
Direction dirFromParent
Direction from the parent to this node.
Definition: server/src/world/Utils.hpp:27
float estimatedCostToGoal
Estimated number of steps to the goal, in our case the euclidean distance.
Definition: server/src/world/Utils.hpp:25
std::pair< int, int > coords
Definition: server/src/world/Utils.hpp:23
float costFromStart
Number of steps from the start.
Definition: server/src/world/Utils.hpp:24