summaryrefslogtreecommitdiffhomepage
path: root/src/search-result.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/search-result.hpp')
-rw-r--r--src/search-result.hpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/search-result.hpp b/src/search-result.hpp
index fc5397a0..1ca13cf2 100644
--- a/src/search-result.hpp
+++ b/src/search-result.hpp
@@ -1,5 +1,4 @@
#pragma once
-#include "compat/defs.hpp"
#include "compat/vector-wrapper-fwd.hpp"
#include "src/global-coords.hpp"
#include <Corrade/Containers/Pointer.h>
@@ -8,20 +7,12 @@ namespace floormat {
struct point;
-class path_search_result final
+struct path_search_result final
{
friend struct test_app;
struct pair;
struct node;
- Pointer<node> _node;
- float _time = 0;
- uint32_t _cost = 0, _distance = (uint32_t)-1;
- bool _found : 1 = false;
-
- static Pointer<node> _pool; // NOLINT(*-avoid-non-const-global-variables)
-
-public:
const point* data() const;
const point& operator[](size_t index) const;
size_t size() const;
@@ -34,10 +25,10 @@ public:
uint32_t distance() const;
void set_distance(uint32_t dist);
bool is_simplified() const;
- const pair& simplified();
+ ArrayView<const pair> simplified();
vector_wrapper<point, vector_wrapper_repr::ref> raw_path();
- vector_wrapper<point, vector_wrapper_repr::ref> raw_simplified_path();
+ vector_wrapper<pair, vector_wrapper_repr::ref> raw_simplified_path();
ArrayView<const point> path() const;
explicit operator ArrayView<const point>() const;
explicit operator bool() const;
@@ -48,6 +39,14 @@ public:
path_search_result(path_search_result&&) noexcept;
path_search_result& operator=(path_search_result&&) noexcept;
~path_search_result() noexcept;
+
+private:
+ Pointer<node> _node;
+ float _time = 0;
+ uint32_t _cost = 0, _distance = (uint32_t)-1;
+ bool _found : 1 = false;
+
+ static Pointer<node> _pool; // NOLINT(*-avoid-non-const-global-variables)
};
} // namespace floormat