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()
|
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()
|
static |
Bind and seed the card's selected attributes exactly once.
在文件 CardAttributes.cpp 第 24 行定义.
引用了 attackAttribute, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Status::failure(), healthAttribute, eve::NoOp, eve::Status::success() , 以及 eve::Result< T >::success().
被这些函数引用 addModifier(), eve::card::Card::applyEffect(), eve::card::Card::newCard(), project(), restore(), setBase() , 以及 snapshot().
◆ project()
|
static |
Project canonical values into the legacy integer Stats fields.
在文件 CardAttributes.cpp 第 42 行定义.
引用了 eve::Applied, attackAttribute, ensure(), eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Status::failure(), healthAttribute, eve::InvariantViolation, eve::Status::success(), eve::Result< T >::success(), value , 以及 values.
被这些函数引用 addModifier(), eve::card::CardData::describe(), read(), eve::card::renderCard(), restore() , 以及 setBase().
◆ read()
|
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()
|
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()
|
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()
|
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
|
staticconstexpr |
在文件 CardAttributes.h 第 28 行定义.
◆ healthAttribute
|
staticconstexpr |
在文件 CardAttributes.h 第 29 行定义.
被这些函数引用 ensure(), project() , 以及 eve::card::Card::step().
该类的文档由以下文件生成:
- src/modules/card/CardAttributes.h
- src/modules/card/CardAttributes.cpp