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

Connects an RTS player's economy to one atomic gameplay payment. 更多...

#include <RTSEconomy.h>

Public 成员函数

 RTSEconomyAdapter (eve::economy::EconomyLedger &ledger)
 Bind this adapter to a caller-owned RTS economy ledger.
 
 RTSEconomyAdapter (const RTSEconomyAdapter &)=delete
 
RTSEconomyAdapter & operator= (const RTSEconomyAdapter &)=delete
 
 RTSEconomyAdapter (RTSEconomyAdapter &&)=delete
 
RTSEconomyAdapter & operator= (RTSEconomyAdapter &&)=delete
 
 ~RTSEconomyAdapter ()=default
 Rts economy adapter.
 
eve::resource::IResourceAccount & account () noexcept
 Return the account view for direct reservation/credit operations.
 
eve::Result< eve::transaction::TransactionReceipt > pay (const eve::resource::CostSpec &cost, eve::transaction::ITransactionParticipant &effect, std::string transactionId={})
 Atomically pay an RTS cost and publish its domain effect.
 
eve::Result< eve::resource::Receipt > credit (const eve::resource::CostSpec &cost)
 Credit the ledger through the common account protocol.
 

详细描述

Connects an RTS player's economy to one atomic gameplay payment.

EconomyLedger remains the authoritative balance/income/expense store. This adapter owns only the account reservation protocol and delegates all payment lifecycle work to AtomicResourcePayment. The ledger is borrowed and must outlive the adapter; calls are synchronous on its owner thread.

在文件 RTSEconomy.h 第 26 行定义.

构造及析构函数说明

◆ RTSEconomyAdapter() [1/3]

eve::rts::RTSEconomyAdapter::RTSEconomyAdapter ( eve::economy::EconomyLedger &  ledger)
explicit

Bind this adapter to a caller-owned RTS economy ledger.

在文件 RTSEconomy.cpp 第 7 行定义.

◆ RTSEconomyAdapter() [2/3]

eve::rts::RTSEconomyAdapter::RTSEconomyAdapter ( const RTSEconomyAdapter &  )
delete

◆ RTSEconomyAdapter() [3/3]

eve::rts::RTSEconomyAdapter::RTSEconomyAdapter ( RTSEconomyAdapter &&  )
delete

◆ ~RTSEconomyAdapter()

eve::rts::RTSEconomyAdapter::~RTSEconomyAdapter ( )
default

Rts economy adapter.

成员函数说明

◆ account()

eve::resource::IResourceAccount & eve::rts::RTSEconomyAdapter::account ( )
noexcept

Return the account view for direct reservation/credit operations.

返回
Borrowed account whose nonce is unique to this ledger adapter.

在文件 RTSEconomy.cpp 第 9 行定义.

◆ credit()

eve::Result< eve::resource::Receipt > eve::rts::RTSEconomyAdapter::credit ( const eve::resource::CostSpec &  cost)

Credit the ledger through the common account protocol.

参数
costCanonical positive resource quantity to add.
返回
A checked credit receipt or a structured capacity/range failure.

在文件 RTSEconomy.cpp 第 18 行定义.

引用了 cost , 以及 eve::economy::EconomyLedgerResourceAccount::credit().

◆ operator=() [1/2]

RTSEconomyAdapter & eve::rts::RTSEconomyAdapter::operator= ( const RTSEconomyAdapter &  )
delete

◆ operator=() [2/2]

RTSEconomyAdapter & eve::rts::RTSEconomyAdapter::operator= ( RTSEconomyAdapter &&  )
delete

◆ pay()

eve::Result< eve::transaction::TransactionReceipt > eve::rts::RTSEconomyAdapter::pay ( const eve::resource::CostSpec &  cost,
eve::transaction::ITransactionParticipant &  effect,
std::string  transactionId = {} 
)

Atomically pay an RTS cost and publish its domain effect.

参数
costCanonical positive cost, borrowed for this call.
effectBorrowed effect participant; it is prepared before debit.
transactionIdNon-empty correlation id; empty derives from the cost path.
返回
Committed transaction receipt or rollback/compensation diagnostics.

在文件 RTSEconomy.cpp 第 11 行定义.

引用了 cost, effect , 以及 eve::transaction::AtomicResourcePayment::execute().


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