载入中...
搜索中...
未找到
TacticsPath.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
8
9#include <map>
10#include <vector>
11
12namespace eve::tactics {
13
15enum class CellRangeMetric : std::uint8_t { Manhattan, Chebyshev, Hex };
16
20 int cost = 0;
21};
22
31public:
33 [[nodiscard]] const std::vector<ReachableCell>& cells() const noexcept { return cells_; }
35 [[nodiscard]] bool contains(Cell cell) const noexcept;
37 [[nodiscard]] Result<int> cost(Cell cell) const;
39 [[nodiscard]] Result<std::vector<Cell>> pathTo(Cell target) const;
40
41private:
42 friend class PathQuery;
43 Cell origin_;
44 std::vector<ReachableCell> cells_;
45 std::map<Cell, Cell> predecessor_;
46};
47
56public:
64 [[nodiscard]] static Result<Reachability> reachable(const BoardState& board, SubjectRef subject, int budget);
65
71 int budget);
72
82 [[nodiscard]] static Result<std::vector<Cell>> cellsInRange(const BoardState& board, Cell origin, int minimum,
83 int maximum, CellRangeMetric metric);
84};
85
86} // namespace eve::tactics
LogicalId target
int subject
Definition AnimSmr.cpp:163
eve::resource::CostSpec cost
#define EVENGINE_API_DOMAINS
Definition Export.h:110
float maximum[3]
float minimum[3]
std::string path
Definition PlayHost.cpp:110
V3 origin
Definition RoadBake.cpp:138
Cell cell
BoardState board
Deterministic board values and short-root ECS entities for tactics.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Strong, domain-neutral reference to a runtime subject.
Definition SubjectRef.h:26
Authoritative board facts and occupancy indexes for one battle.
Pure deterministic board path algorithms.
Definition TacticsPath.h:55
Owning result of one deterministic reachability query.
Definition TacticsPath.h:30
const std::vector< ReachableCell > & cells() const noexcept
Return reachable cells in deterministic coordinate order.
Definition TacticsPath.h:33
CellRangeMetric
Deterministic logical distance used by cellsInRange.
Definition TacticsPath.h:15
Logical board coordinate independent of rendering projection.
One reachable cell and its minimum fixed-point movement cost.
Definition TacticsPath.h:18