载入中...
搜索中...
未找到
eve::card::CardPlayPaymentAdapter类 参考final

Connects a card's mana field to the owning player's resource account. 更多...

#include <CardPlay.h>

静态 Public 成员函数

static eve::Result< eve::transaction::TransactionReceipt > play (CardPlayRequest request)
 Execute condition, movement, card effect and Mana as one transaction.
 
static eve::Result< std::optional< eve::resource::CostSpec > > manaCost (const CardDefinition &definition)
 Convert a non-negative card mana value into a canonical cost.
 
static eve::Result< eve::transaction::TransactionReceipt > play (CardData &card, const CardDefinition &definition, eve::resource::IResourceAccount &playerAccount, std::string transactionId={})
 Play one card and charge its player's mana atomically.
 

详细描述

Connects a card's mana field to the owning player's resource account.

CardDefinition::cost is only a domain definition value. The player's account is supplied by the composition root, and the payment is routed through AtomicResourcePayment, so card state and mana are one transaction.

在文件 CardPlay.h 第 178 行定义.

成员函数说明

◆ manaCost()

eve::Result< std::optional< eve::resource::CostSpec > > eve::card::CardPlayPaymentAdapter::manaCost ( const CardDefinition &  definition)
static

Convert a non-negative card mana value into a canonical cost.

参数
definitionBorrowed card definition.
返回
A mana CostSpec, or an empty optional for a free card.

在文件 CardPlay.cpp 第 308 行定义.

引用了 cost, eve::Diagnostic::error(), eve::InvalidArgument , 以及 eve::resource::CostSpec::single().

被这些函数引用 play().

◆ play() [1/2]

eve::Result< eve::transaction::TransactionReceipt > eve::card::CardPlayPaymentAdapter::play ( CardData &  card,
const CardDefinition &  definition,
eve::resource::IResourceAccount &  playerAccount,
std::string  transactionId = {} 
)
static

Play one card and charge its player's mana atomically.

参数
cardBorrowed CardData whose authoritative state becomes Played.
definitionBorrowed definition supplying the mana cost.
playerAccountBorrowed account owned by the player/profile.
transactionIdNon-empty correlation id; empty derives from definition id.
返回
Committed transaction receipt or structured failure. A failed condition/effect/payment leaves both card and account unchanged.

在文件 CardPlay.cpp 第 321 行定义.

引用了 eve::card::CardPlayRequest::card, play() , 以及 request.

◆ play() [2/2]

eve::Result< eve::transaction::TransactionReceipt > eve::card::CardPlayPaymentAdapter::play ( CardPlayRequest  request)
static

Execute condition, movement, card effect and Mana as one transaction.

参数
requestBorrowed composition request; all pointed-to objects must remain live until the Result is returned.
返回
A committed receipt, or a failure with all prepared/committed participants rolled back or compensated.
备注
This is the preferred Card entry point. Condition evaluation is pure preflight; it cannot debit or move a card. No caller-side participant assembly is required.

在文件 CardPlay.cpp 第 332 行定义.

引用了 condition, eve::decision::conditionReasonCodeName(), context, cost, eve::Diagnostic::error(), eve::card::CardPlayConditionAdapter::evaluate(), eve::transaction::AtomicResourcePayment::execute(), eve::Result< T >::failure(), eve::InvalidArgument, manaCost(), eve::PreconditionViolation, request , 以及 state.

被这些函数引用 play() , 以及 eve::card::Card::play().


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