载入中...
搜索中...
未找到
eve::rts::RTSProductionActionAdapter类 参考final

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]

eve::Result< RTSBuildReceipt > eve::rts::RTSProductionActionAdapter::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 = {} 
)
static

Run the canonical build transaction against a live RTS Building.

参数
buildingBorrowed Building whose Orders and Production components are authoritative.
actionBorrowed shared ActionRuntime used for the action lifecycle.
accountBorrowed authoritative economy account.
costPositive resource cost copied into the transaction.
productStable product identifier to enqueue.
durationPositive deterministic production duration.
productionKindDomain production kind, defaulting to unit.
priorityQueue priority for the production task.
transactionIdOptional transaction correlation id.
resourceReservesFaction/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]

eve::Result< RTSBuildReceipt > eve::rts::RTSProductionActionAdapter::build ( RTSBuildRequest  request)
static

Atomically enqueue an RTS build/production action and charge cost.

参数
requestBorrowed 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]

eve::Result< RTSCancelProductionReceipt > eve::rts::RTSProductionActionAdapter::cancel ( Building &  building,
resource::IResourceAccount &  account,
std::string  productionTaskId,
std::string  orderId,
resource::CostSpec  refund,
std::string  reason = "production cancelled" 
)
static

Cancel a building production task and refund its complete canonical cost atomically.

参数
buildingBorrowed building owning both authoritative queues.
accountBorrowed authoritative resource account.
productionTaskIdStable task id returned by build().
orderIdStable order id returned by build().
refundExact multi-resource cost originally paid by the task.
reasonRetained 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]


该类的文档由以下文件生成: