summaryrefslogtreecommitdiffhomepage
path: root/src/path-search-result.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-11-06 13:50:54 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-11-06 13:54:00 +0100
commit2823373cd60021fde10007dc94d04eef99840f7f (patch)
tree61965be596bbb6ab11ccedd1b8ec571e42a3ebe2 /src/path-search-result.hpp
parentefef0b4e26d02f09e542adae190a8a6eeafb02f9 (diff)
pathfinding work
Diffstat (limited to 'src/path-search-result.hpp')
-rw-r--r--src/path-search-result.hpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/path-search-result.hpp b/src/path-search-result.hpp
index 6ae9b5be..89e240b8 100644
--- a/src/path-search-result.hpp
+++ b/src/path-search-result.hpp
@@ -19,6 +19,10 @@ struct path_search_result final
void set_cost(uint32_t value);
float time() const;
void set_time(float time);
+ bool is_found() const;
+ void set_found(bool value);
+ uint32_t distance() const;
+ void set_distance(uint32_t dist);
std::vector<point>& path();
const std::vector<point>& path() const;
@@ -32,8 +36,6 @@ struct path_search_result final
~path_search_result() noexcept;
private:
- static constexpr size_t min_length = TILE_MAX_DIM*2;
-
struct node
{
friend struct path_search_result;
@@ -53,7 +55,8 @@ private:
std::unique_ptr<node> _node;
float _time = 0;
- uint32_t _cost = 0;
+ uint32_t _cost = 0, _distance = (uint32_t)-1;
+ bool _found : 1 = false;
};
} // namespace floormat