Coordinates Orders, Production, Action and resource payment. 更多...
#include <RTSProductionAction.h>
静态 Public 成员函数 | |
| static eve::Result< RTSBuildReceipt > | build (Building &building, action::ActionRuntime &action, resource::IResourceAccount &account, resource::CostSpec cost, std::string product, Duration duration, std::string productionKind="unit", int priority=0, std::string transactionId={}, std::vector< RTSProductionResourceReserve > resourceReserves={}, eve::definition::DefinitionHandle definition={}) |
| Run the canonical build transaction against a live RTS Building. | |
| static eve::Result< RTSBuildReceipt > | build (RTSBuildRequest request) |
| Atomically enqueue an RTS build/production action and charge cost. | |
| static eve::Result< RTSCancelProductionReceipt > | cancel (Building &building, resource::IResourceAccount &account, std::string productionTaskId, std::string orderId, resource::CostSpec refund, std::string reason="production cancelled") |
| Cancel a building production task and refund its complete canonical cost atomically. | |
| static eve::Result< RTSCancelProductionReceipt > | cancel (RTSCancelProductionRequest request) |
| Cancel through explicitly injected canonical production, order and account ports. | |
详细描述
Coordinates Orders, Production, Action and resource payment.
Every mutable subsystem is staged before the account is debited. Queue and production snapshots are restored on compensation. The Action lifecycle is part of the same participant set as the domain changes, and the shared payment facade appends the debit to that set, so a failed Action or payment cannot leave a charged, partially published build. This is the preferred RTS build entry point; callers do not manually combine payment and execution.
在文件 RTSProductionAction.h 第 113 行定义.
成员函数说明
◆ build() [1/2]
|
static |
Run the canonical build transaction against a live RTS Building.
- 参数
-
building Borrowed Building whose Orders and Production components are authoritative. action Borrowed shared ActionRuntime used for the action lifecycle. account Borrowed authoritative economy account. cost Positive resource cost copied into the transaction. product Stable product identifier to enqueue. duration Positive deterministic production duration. productionKind Domain production kind, defaulting to unit.priority Queue priority for the production task. transactionId Optional transaction correlation id. resourceReserves Faction/game-owned floors applied before the canonical transaction.
- 返回
- Complete build receipt, or a failure without partial queue/payment state.
在文件 RTSProductionAction.cpp 第 274 行定义.
引用了 account, action, build(), cost, duration, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::InvariantViolation, priority, eve::rts::RTSBuildRequest::production, request , 以及 subject.
被这些函数引用 build().
◆ build() [2/2]
|
static |
Atomically enqueue an RTS build/production action and charge cost.
- 参数
-
request Borrowed composition input.
- 返回
- A complete transaction receipt and created identities, or a failure with no observable queue/payment partial state.
在文件 RTSProductionAction.cpp 第 311 行定义.
引用了 action, eve::Applied, context, eve::resource::CostSpec::create(), eve::Diagnostic::error(), eve::transaction::AtomicResourcePayment::execute(), eve::Result< T >::failure(), eve::LogicalId::fromParts(), id, eve::InvalidArgument, order, eve::rts::RTSBuildReceipt::orderId, eve::PreconditionViolation, request, eve::Status::success() , 以及 eve::Result< T >::success().
◆ cancel() [1/2]
|
static |
Cancel a building production task and refund its complete canonical cost atomically.
- 参数
-
building Borrowed building owning both authoritative queues. account Borrowed authoritative resource account. productionTaskId Stable task id returned by build(). orderId Stable order id returned by build(). refund Exact multi-resource cost originally paid by the task. reason Retained cancellation reason for both canonical queues.
- 返回
- Refund receipt, or failure with both queues restored and no refund applied.
在文件 RTSProductionAction.cpp 第 392 行定义.
引用了 account, cancel(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvariantViolation, eve::rts::RTSCancelProductionRequest::production , 以及 request.
被这些函数引用 cancel().
◆ cancel() [2/2]
|
static |
Cancel through explicitly injected canonical production, order and account ports.
在文件 RTSProductionAction.cpp 第 412 行定义.
引用了 eve::Applied, eve::orders::CommandQueue::cancel(), eve::production::WorkQueue::cancel(), eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Result< void >::ignore(), eve::InvalidArgument, eve::InvariantViolation, request, eve::orders::CommandQueue::restore(), eve::production::WorkQueue::restore(), eve::production::WorkQueue::snapshot(), eve::Status::success() , 以及 eve::Result< T >::success().
该类的文档由以下文件生成:
- src/modules/rts/RTSProductionAction.h
- src/modules/rts/RTSProductionAction.cpp