载入中...
搜索中...
未找到
RTSEconomy.cpp
浏览该文件的文档.
1#include "rts/RTSEconomy.h"
2
3#include <utility>
4
5namespace eve::rts {
6
8
10
13 if (transactionId.empty()) transactionId = "rts.economy.payment";
15 eve::transaction::TransactionContext(std::move(transactionId)), account_, cost, effect);
16}
17
21
22} // namespace eve::rts
eve::resource::CostSpec cost
std::unique_ptr< ParticleEffect > effect
RTS composition adapter over the canonical EconomyLedger account.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
eve::Result< eve::resource::Receipt > credit(const eve::resource::CostSpec &cost) override
Atomically credit all items immediately.
单个玩家的资源账本:当前量、上限、收支与浪费统计。
Immutable canonical multi-resource cost.
Provider-neutral resource account contract.
eve::Result< eve::resource::Receipt > credit(const eve::resource::CostSpec &cost)
Credit the ledger through the common account protocol.
eve::resource::IResourceAccount & account() noexcept
Return the account view for direct reservation/credit operations.
Definition RTSEconomy.cpp:9
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.
RTSEconomyAdapter(eve::economy::EconomyLedger &ledger)
Bind this adapter to a caller-owned RTS economy ledger.
Definition RTSEconomy.cpp:7
static eve::Result< TransactionReceipt > execute(const TransactionContext &context, std::span< ITransactionParticipant * > participants)
Execute already prepared domain participants as one transaction.
Synchronous participant contract for one coordinator transaction.
Immutable context shared by every participant of one transaction.
Definition Transaction.h:30