载入中...
搜索中...
未找到
LineOfSight.cpp
浏览该文件的文档.
137 Diagnostic::error(DiagnosticCode::Unsupported, "line of sight does not cross layers", "from.layer"));
140 Diagnostic::error(DiagnosticCode::NotFound, "line of sight origin is not on the board", "from"));
154Result<CoverLevel> GridCoverPolicy::cover(const BoardState& board, Cell attacker, Cell target) const {
160 Diagnostic::error(DiagnosticCode::Unsupported, "cover does not cross layers", "attacker.layer"));
192Result<std::vector<Cell>> visibleCellsInRange(const BoardState& board, const ILineOfSightPolicy& policy,
Stable, structured diagnostics shared by engine modules.
Injectable line-of-sight and cover policies over the tactical board.
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
Result< CoverLevel > cover(const BoardState &board, Cell attacker, Cell target) const override
Cover.
Definition LineOfSight.cpp:154
Result< bool > visible(const BoardState &board, Cell from, Cell to) const override
Visible.
Definition LineOfSight.cpp:131
Answers "can @p from see @p to" for one board.
Definition LineOfSight.h:61
virtual Result< bool > visible(const BoardState &board, Cell from, Cell to) const =0
Report whether from can see to.
static Result< std::vector< Cell > > cellsInRange(const BoardState &board, Cell origin, int minimum, int maximum, CellRangeMetric metric)
Enumerate existing cells whose logical distance is within an inclusive range.
Definition TacticsPath.cpp:178
Definition Interaction.cpp:13
std::string_view coverLevelName(CoverLevel level) noexcept
Stable protocol spelling of a cover level.
Definition LineOfSight.cpp:122
Result< std::vector< Cell > > visibleCellsInRange(const BoardState &board, const ILineOfSightPolicy &policy, Cell origin, int minimum, int maximum, CellRangeMetric metric)
Cells within a metric range of origin that policy can actually see.
Definition LineOfSight.cpp:192
std::shared_ptr< ILineOfSightPolicy > gridLineOfSightPolicy()
The process-wide built-in line-of-sight policy.
Definition LineOfSight.cpp:182
constexpr std::string_view kSightBlockerTag
Cell tag that makes a cell block line of sight.
Definition LineOfSight.h:39
@ ExplicitGraph
@ HexAxial
@ Full
Full protection: a blocker sits between the attacker and the target.
@ Half
Partial protection: an adjacent blocker, but not on the incoming line.
std::shared_ptr< ICoverPolicy > gridCoverPolicy()
The process-wide built-in cover policy (same ownership remarks as above).
Definition LineOfSight.cpp:187
@ NotFound
@ Unsupported
Logical board coordinate independent of rendering projection.
Definition TacticsTypes.h:30