载入中...
搜索中...
未找到
TacticsLineOfSightAdapter.cpp
浏览该文件的文档.
42 if (point.space() == sensing::CoordinateSpace::Grid2D) return Result<Cell>::success(Cell{point.x(), point.y(), 0});
68 if (bound_ && sameHandle(battle_, battle)) return Result<void>::success(Status::success(StatusCode::NoOp));
87Result<sensing::LineOfSightResult> TacticsLineOfSightAdapter::query(const sensing::TargetLocation& from,
92 DiagnosticCode::Unsupported, "no tactics battle is bound for grid line of sight", "lineOfSight.battle"));
101 const ILineOfSightPolicy& policy = registered != nullptr ? *registered : *gridLineOfSightPolicy();
Stable, structured diagnostics shared by engine modules.
One registered line-of-sight provider that dispatches to backends by coordinate space.
Injectable line-of-sight and cover policies over the tactical board.
Grid line of sight for sensing consumers, answered from a bound tactics board.
Deterministic board values and short-root ECS entities for tactics.
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
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.h:81
Authoritative board facts and occupancy indexes for one battle.
Definition TacticsTypes.h:155
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.
Answers grid line-of-sight queries from the bound tactics battle.
Definition TacticsLineOfSightAdapter.h:39
Result< sensing::LineOfSightResult > query(const sensing::TargetLocation &from, const sensing::TargetLocation &to) const override
Tests the segment between two same-space locations.
Definition TacticsLineOfSightAdapter.cpp:87
Result< void > bindBattle(ecs::EntityHandle battle)
Bind the battle this adapter answers for.
Definition TacticsLineOfSightAdapter.cpp:64
Result< void > unbindBattle(ecs::EntityHandle battle)
Release the binding when battle is the bound one; otherwise NoOp.
Definition TacticsLineOfSightAdapter.cpp:79
std::variant< WorldPoint, GridPoint > TargetLocation
Either a world point or a grid point, with the tag retained.
Definition Targeting.h:198
Result< LineOfSightRouter * > ensureLineOfSightRouter()
The process-wide router, registered as the ILineOfSightQuery capability.
Definition LineOfSightRouter.cpp:33
Definition Interaction.cpp:13
std::shared_ptr< ILineOfSightPolicy > gridLineOfSightPolicy()
The process-wide built-in line-of-sight policy.
Definition LineOfSight.cpp:182
Result< void > registerTacticsLineOfSightProvider()
Claim the grid coordinate spaces for the tactics adapter.
Definition TacticsLineOfSightAdapter.cpp:113
TacticsLineOfSightAdapter & tacticsLineOfSightAdapter()
The process-wide adapter instance the capability answers with.
Definition TacticsLineOfSightAdapter.cpp:59
@ Unsupported
@ StaleHandle
@ Conflict
@ NoOp
@ Applied
Result of one injected line-of-sight query.
Definition Targeting.h:417