载入中...
搜索中...
未找到
TacticsPath.cpp
浏览该文件的文档.
47 Diagnostic::error(DiagnosticCode::NotFound, "tactics reachability subject is not placed", "subject"));
64Result<SearchOutcome> expand(const BoardState& board, SubjectRef subject, Cell origin, int budget,
90 const long long step = static_cast<long long>(cellState.moveCost) + static_cast<long long>(extra);
131 DiagnosticCode::InvariantViolation, "tactics reachability predecessor chain is incomplete", "path"));
138Result<Reachability> PathQuery::reachable(const BoardState& board, SubjectRef subject, int budget) {
154Result<std::vector<Cell>> PathQuery::path(const BoardState& board, SubjectRef subject, Cell target, int budget) {
171 DiagnosticCode::InvariantViolation, "tactics reachability predecessor chain is incomplete", "path"));
178Result<std::vector<Cell>> PathQuery::cellsInRange(const BoardState& board, Cell origin, int minimum, int maximum,
183 "coordinate range metrics do not apply to graph cell identities; use reachability", "topology"));
186 DiagnosticCode::InvalidArgument, "tactics range bounds must be ordered and non-negative", "range"));
Deterministic fixed-cost tactics path queries.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Authoritative board facts and occupancy indexes for one battle.
Definition TacticsTypes.h:155
Result< CellState > cell(Cell cell) const
Return an owning copy of a cell fact, or NotFound.
Definition TacticsTypes.cpp:24
std::optional< EdgeState > tryEdge(Cell from, Cell to) const
Return a declared directed edge, or empty when none is declared.
Definition TacticsTypes.cpp:162
std::optional< SubjectRef > occupant(Cell cell) const
Return the occupying subject, or empty when the cell is unoccupied.
Definition TacticsTypes.cpp:82
std::optional< Cell > position(SubjectRef subject) const
Return the subject cell, or empty when it is not placed.
Definition TacticsTypes.cpp:87
static Result< Reachability > reachable(const BoardState &board, SubjectRef subject, int budget)
Compute all unoccupied reachable cells for a placed subject.
Definition TacticsPath.cpp:138
Owning result of one deterministic reachability query.
Definition TacticsPath.h:30
bool contains(Cell cell) const noexcept
Return whether a cell is reachable within the queried budget.
Definition TacticsPath.cpp:107
Result< int > cost(Cell cell) const
Return the minimum cost for a reachable cell, or NotFound.
Definition TacticsPath.cpp:113
Result< std::vector< Cell > > pathTo(Cell target) const
Reconstruct an origin-to-target path, or NotFound.
Definition TacticsPath.cpp:122
constexpr HexDirection next(HexDirection d) noexcept
The next direction clockwise (NW wraps to NE).
Definition HexMetrics.h:76
Definition Interaction.cpp:13
@ InvalidArgument
@ NotFound
@ Unsupported
@ InvariantViolation
Logical board coordinate independent of rendering projection.
Definition TacticsTypes.h:30
One reachable cell and its minimum fixed-point movement cost.
Definition TacticsPath.h:18