载入中...
搜索中...
未找到
LineOfSightRouter.cpp
浏览该文件的文档.
47std::optional<CoordinateSpace> LineOfSightRouter::spaceOf(const TargetLocation& location) noexcept {
52Result<void> LineOfSightRouter::addProvider(CoordinateSpace space, const ILineOfSightQuery* provider) {
69Result<void> LineOfSightRouter::removeProvider(CoordinateSpace space, const ILineOfSightQuery* provider) {
Stable, structured diagnostics shared by engine modules.
One registered line-of-sight provider that dispatches to backends by coordinate space.
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
Routes each line-of-sight query to the backend that claimed its coordinate space.
Definition LineOfSightRouter.h:37
std::vector< CoordinateSpace > spaces() const
Claimed spaces in enum order, so a caller can report coverage deterministically.
Definition LineOfSightRouter.cpp:82
Result< void > addProvider(CoordinateSpace space, const ILineOfSightQuery *provider)
Claim one coordinate space for a backend.
Definition LineOfSightRouter.cpp:52
bool hasProvider(CoordinateSpace space) const noexcept
Whether some backend currently answers for space.
Definition LineOfSightRouter.cpp:77
Result< LineOfSightResult > query(const TargetLocation &from, const TargetLocation &to) const override
Answer one segment query by routing it to the backend for its coordinate space.
Definition LineOfSightRouter.cpp:90
Result< void > removeProvider(CoordinateSpace space, const ILineOfSightQuery *provider)
Release a claimed space when provider is the one that claimed it.
Definition LineOfSightRouter.cpp:69
Definition RTSSystems.h:257
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
CoordinateSpace
Coordinate spaces are not interchangeable, even when dimensions match.
Definition Targeting.h:37
std::string_view coordinateSpaceName(CoordinateSpace space) noexcept
Returns the stable protocol name for a coordinate space.
Definition Targeting.cpp:556
@ InvalidArgument
@ Unsupported
@ Conflict
@ NoOp
@ Applied