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]
|
explicit |
Bind this adapter to a caller-owned RTS economy ledger.
在文件 RTSEconomy.cpp 第 7 行定义.
◆ RTSEconomyAdapter() [2/3]
|
delete |
◆ RTSEconomyAdapter() [3/3]
|
delete |
◆ ~RTSEconomyAdapter()
|
default |
Rts economy adapter.
成员函数说明
◆ 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.
- 参数
-
cost Canonical 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]
|
delete |
◆ operator=() [2/2]
|
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.
- 参数
-
cost Canonical positive cost, borrowed for this call. effect Borrowed effect participant; it is prepared before debit. transactionId Non-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().
该类的文档由以下文件生成:
- src/modules/rts/RTSEconomy.h
- src/modules/rts/RTSEconomy.cpp