载入中...
搜索中...
未找到
RTSAction.cpp
浏览该文件的文档.
44ActionAdapter::ActionAdapter(action::ActionRuntime& runtime) : impl_(std::make_unique<Impl>(runtime)) {}
52Result<ActionExecutionResult> ActionAdapter::execute(Unit& unit, const OrderRecord& order, const SimulationStep& step) {
58 Diagnostic::error(DiagnosticCode::InvariantViolation, "RTS action adapter is not initialized", "adapter"));
80 Diagnostic::error(DiagnosticCode::InvalidArgument, "RTS order definition is not a valid LogicalId",
118 const ActionExecutionResult result{completed ? ActionDisposition::Completed : ActionDisposition::Pending};
Renderer- and ruleset-neutral gameplay action pipeline.
RTS adapter boundary over the shared action lifecycle.
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 std::optional< LogicalId > fromParts(std::string_view namespaceName, std::string_view name)
Builds a logical ID from separate namespace and name components.
Definition Identity.cpp:48
static std::optional< LogicalId > parse(std::string_view text)
Parses a scoped logical name.
Definition Identity.cpp:36
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
void clear() noexcept
Forget runtime execution correlations so restored orders are rebound on their next step.
Definition RTSAction.cpp:48
ActionAdapter(action::ActionRuntime &runtime)
Bind the adapter to an owner-thread action runtime.
Definition RTSAction.cpp:44
Result< ActionExecutionResult > execute(Unit &unit, const OrderRecord &order, const SimulationStep &step) override
Execute or advance one active RTS order.
Definition RTSAction.cpp:52
@ Completed
@ Cancelled
@ Failed
Definition RTS.cpp:24
@ Completed
@ Pending
const char * orderKindName(OrderKind kind) noexcept
Return the stable lower-case spelling of an RTS order kind.
Definition RTSTypes.cpp:177
@ InvalidArgument
@ InvariantViolation
@ Pending
@ Applied
Definition Container.h:602
Immutable-by-convention definition of one action kind.
Definition Action.h:90
One caller-owned request to instantiate an action execution.
Definition Action.h:127
action::ActionExecutionId execution
Definition RTSAction.cpp:35
Impl(action::ActionRuntime &runtimeValue)
Definition RTSAction.cpp:38
Owning, domain-local projection of an action adapter outcome.
Definition RTSAction.h:27
Owning projection of the active generic order used by RTS systems.
Definition RTSTypes.h:117