载入中...
搜索中...
未找到
RTSCrowdLifetime.cpp
浏览该文件的文档.
1#include "rts/RTS.h"
2
3namespace eve::rts {
4Result<void> RTS::checkCrowdLifetime() {
5 if (!crowd_ || crowdLifetime_.isAlive()) return Result<void>::success();
6 for (const auto& handle : units_) {
7 auto* unit = dynamic_cast<Unit*>(ecs::try_get(handle));
8 if (!unit) continue;
9 unit->crowd()->runtimeAgent = {};
10 unit->crowd()->runtimeOwner = 0;
11 unit->crowd()->runtimeBindingKey.clear();
12 }
14 Diagnostic::error(DiagnosticCode::Conflict, "Canonical Crowd provider is unavailable", "crowdProvider"));
15}
16} // namespace eve::rts
PrimitiveHandle handle
RTS module owner and phase-one composition profile entry point.
TacticalUnit * unit
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
bool isAlive() const noexcept
Query original owner liveness; owner-thread only.
static Result success(T value)
Construct a successful result owning value.
Definition Result.h:185
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196