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

Adapts CardData's attack/health values to the canonical AttributeSet. 更多...

#include <CardAttributes.h>

静态 Public 成员函数

static eve::Result< void > ensure (CardData &card)
 Bind and seed the card's selected attributes exactly once.
 
static eve::Result< double > read (CardData &card, std::string_view attribute)
 Read a selected final card attribute and refresh compatibility fields.
 
static eve::Result< void > setBase (CardData &card, std::string_view attribute, double value)
 Set a selected canonical base and refresh the legacy projection.
 
static eve::Result< eve::attributes::ModifierId > addModifier (CardData &card, std::string id, std::string_view attribute, std::string source, eve::attributes::AttributeOperation operation, double value, eve::attributes::ModifierPriority priority=eve::attributes::priority::runtime)
 Add a modifier using the shared attribute operation ordering.
 
static eve::Result< void > project (CardData &card)
 Project canonical values into the legacy integer Stats fields.
 
static eve::Result< eve::attributes::AttributeProjectionSnapshot > snapshot (CardData &card)
 Capture attack/health with the owning ECS generation and revision.
 
static eve::Result< void > restore (CardData &card, const eve::attributes::AttributeProjectionSnapshot &snapshot, eve::Revision expectedRevision)
 Restore a card snapshot only when owner and revision still match.
 

静态 Public 属性

static constexpr std::string_view attackAttribute = "attack"
 
static constexpr std::string_view healthAttribute = "health"
 

详细描述

Adapts CardData's attack/health values to the canonical AttributeSet.

The attributes component owns attack and health after first binding. The legacy integer fields are refreshed as a one-way compatibility projection. Card cost remains a resource/payment value, while layout, phase and card membership remain Card-owned state.

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

成员函数说明

◆ addModifier()

eve::Result< eve::attributes::ModifierId > eve::card::CardAttributeAdapter::addModifier ( CardData &  card,
std::string  id,
std::string_view  attribute,
std::string  source,
eve::attributes::AttributeOperation  operation,
double  value,
eve::attributes::ModifierPriority  priority = eve::attributes::priority::runtime 
)
static

Add a modifier using the shared attribute operation ordering.

在文件 CardAttributes.cpp 第 96 行定义.

引用了 ensure(), eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Status::failure(), eve::InvalidArgument, operation, priority, project(), projected, source , 以及 value.

◆ ensure()

eve::Result< void > eve::card::CardAttributeAdapter::ensure ( CardData &  card)
static

◆ project()

eve::Result< void > eve::card::CardAttributeAdapter::project ( CardData &  card)
static

◆ read()

eve::Result< double > eve::card::CardAttributeAdapter::read ( CardData &  card,
std::string_view  attribute 
)
static

Read a selected final card attribute and refresh compatibility fields.

在文件 CardAttributes.cpp 第 65 行定义.

引用了 eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Status::failure(), project(), projected, eve::Result< T >::success(), eve::Unsupported , 以及 value.

被这些函数引用 eve::card::Card::getCardAttribute().

◆ restore()

eve::Result< void > eve::card::CardAttributeAdapter::restore ( CardData &  card,
const eve::attributes::AttributeProjectionSnapshot &  snapshot,
eve::Revision  expectedRevision 
)
static

Restore a card snapshot only when owner and revision still match.

在文件 CardAttributes.cpp 第 130 行定义.

引用了 ensure(), eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Status::failure() , 以及 project().

◆ setBase()

eve::Result< void > eve::card::CardAttributeAdapter::setBase ( CardData &  card,
std::string_view  attribute,
double  value 
)
static

Set a selected canonical base and refresh the legacy projection.

在文件 CardAttributes.cpp 第 84 行定义.

引用了 ensure(), eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Status::failure(), project(), eve::Unsupported , 以及 value.

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

◆ snapshot()

eve::Result< eve::attributes::AttributeProjectionSnapshot > eve::card::CardAttributeAdapter::snapshot ( CardData &  card)
static

Capture attack/health with the owning ECS generation and revision.

在文件 CardAttributes.cpp 第 120 行定义.

引用了 ensure(), eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure() , 以及 eve::Status::failure().

类成员变量说明

◆ attackAttribute

constexpr std::string_view eve::card::CardAttributeAdapter::attackAttribute = "attack"
staticconstexpr

在文件 CardAttributes.h 第 28 行定义.

被这些函数引用 ensure() , 以及 project().

◆ healthAttribute

constexpr std::string_view eve::card::CardAttributeAdapter::healthAttribute = "health"
staticconstexpr

在文件 CardAttributes.h 第 29 行定义.

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


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