blob: ee3d017db3a7a11155cc86dd517e68d5f8d115c2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#pragma once
#include "src/global-coords.hpp"
#include "compat/defs.hpp"
#include <memory>
#include <vector>
namespace floormat {
struct point;
struct path_search_result final
{
friend struct test_app;
const point* data() const;
const point& operator[](size_t index) const;
size_t size() const;
std::vector<point>& path();
const std::vector<point>& path() const;
explicit operator ArrayView<const point>() const;
explicit operator bool() const;
fm_DECLARE_DEFAULT_MOVE_ASSIGNMENT_(path_search_result);
path_search_result(const path_search_result& x) noexcept;
path_search_result& operator=(const path_search_result& x) noexcept;
path_search_result();
~path_search_result() noexcept;
private:
static constexpr size_t min_length = TILE_MAX_DIM*2;
struct node
{
friend struct path_search_result;
friend struct test_app;
node() noexcept;
fm_DECLARE_DELETED_COPY_ASSIGNMENT(node);
fm_DECLARE_DEFAULT_MOVE_ASSIGNMENT_(node);
std::vector<point> vec;
private:
std::unique_ptr<node> _next;
};
static std::unique_ptr<node> _pool; // NOLINT(*-avoid-non-const-global-variables)
std::unique_ptr<node> _node;
};
} // namespace floormat
|