diff options
Diffstat (limited to 'src/path-search-result.cpp')
-rw-r--r-- | src/path-search-result.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/path-search-result.cpp b/src/path-search-result.cpp index bc0ad31f..d805bd31 100644 --- a/src/path-search-result.cpp +++ b/src/path-search-result.cpp @@ -1,7 +1,9 @@ -#include "path-search.hpp" #include "path-search-result.hpp" -#include "src/point.hpp" +//#include "path-search.hpp" #include "compat/assert.hpp" +#include "compat/vector-wrapper.hpp" +#include "path-search-node.hpp" +#include "src/point.hpp" #include <Corrade/Containers/ArrayView.h> #include <utility> @@ -61,6 +63,9 @@ path_search_result& path_search_result::operator=(const path_search_result& x) n return *this; } +path_search_result::path_search_result(path_search_result&&) noexcept = default; +path_search_result& path_search_result::operator=(path_search_result&&) noexcept = default; + size_t path_search_result::size() const { return _node->vec.size(); } path_search_result::node::node() noexcept = default; float path_search_result::time() const { return _time; } @@ -88,7 +93,7 @@ const point& path_search_result::operator[](size_t index) const fm_debug_assert(index < _node->vec.size()); return data()[index]; } -auto path_search_result::path() -> std::vector<point>& { fm_assert(_node); return _node->vec; } -auto path_search_result::path() const -> const std::vector<point>& { fm_assert(_node); return _node->vec; } +vector_wrapper<point> path_search_result::raw_path() { fm_assert(_node); return {_node->vec}; } +ArrayView<const point> path_search_result::path() const { fm_assert(_node); return {_node->vec.data(), _node->vec.size()}; } } // namespace floormat |