载入中...
搜索中...
未找到
eve::weapon::WeaponAttributeAdapter类 参考final

Adapts only Mana/Stamina trigger resources to AttributeProjection. 更多...

#include <WeaponAttributes.h>

静态 Public 成员函数

static eve::Result< void > ensure (WeaponEntity &weapon)
 Bind and seed the selected resource attributes exactly once.
 
static eve::Result< double > read (WeaponEntity &weapon, std::string_view attribute)
 Read a selected final mana/stamina attribute.
 
static eve::Result< void > setBase (WeaponEntity &weapon, std::string_view attribute, double value)
 Set a selected canonical base and refresh Resource compatibility fields.
 
static eve::Result< void > consumeTriggerResource (WeaponEntity &weapon)
 Consume the current weapon's canonical Mana/Stamina trigger cost.
 
static eve::Result< eve::attributes::ModifierId > addModifier (WeaponEntity &weapon, 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 operation/priority/sequence contract.
 
static eve::Result< void > project (WeaponEntity &weapon)
 Project canonical Mana/Stamina values into the legacy Resource component.
 
static eve::Result< eve::attributes::AttributeProjectionSnapshot > snapshot (WeaponEntity &weapon)
 Capture selected resource attributes with owner generation and revision.
 
static eve::Result< void > restore (WeaponEntity &weapon, const eve::attributes::AttributeProjectionSnapshot &snapshot, eve::Revision expectedRevision)
 Restore selected resource attributes after owner/revision checks.
 

静态 Public 属性

static constexpr std::string_view manaAttribute = "mana"
 
static constexpr std::string_view maxManaAttribute = "max_mana"
 
static constexpr std::string_view staminaAttribute = "stamina"
 
static constexpr std::string_view maxStaminaAttribute = "max_stamina"
 

详细描述

Adapts only Mana/Stamina trigger resources to AttributeProjection.

Ammo, charges, reload state, cooldown, spread, recoil and attack phase remain weapon-owned state. The legacy Resource fields are refreshed only as a one-way projection after canonical reads/writes.

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

成员函数说明

◆ addModifier()

eve::Result< eve::attributes::ModifierId > eve::weapon::WeaponAttributeAdapter::addModifier ( WeaponEntity &  weapon,
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 operation/priority/sequence contract.

在文件 WeaponAttributes.cpp 第 137 行定义.

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

◆ consumeTriggerResource()

eve::Result< void > eve::weapon::WeaponAttributeAdapter::consumeTriggerResource ( WeaponEntity &  weapon)
static

◆ ensure()

eve::Result< void > eve::weapon::WeaponAttributeAdapter::ensure ( WeaponEntity &  weapon)
static

◆ project()

eve::Result< void > eve::weapon::WeaponAttributeAdapter::project ( WeaponEntity &  weapon)
static

◆ read()

eve::Result< double > eve::weapon::WeaponAttributeAdapter::read ( WeaponEntity &  weapon,
std::string_view  attribute 
)
static

◆ restore()

eve::Result< void > eve::weapon::WeaponAttributeAdapter::restore ( WeaponEntity &  weapon,
const eve::attributes::AttributeProjectionSnapshot &  snapshot,
eve::Revision  expectedRevision 
)
static

Restore selected resource attributes after owner/revision checks.

在文件 WeaponAttributes.cpp 第 171 行定义.

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

◆ setBase()

eve::Result< void > eve::weapon::WeaponAttributeAdapter::setBase ( WeaponEntity &  weapon,
std::string_view  attribute,
double  value 
)
static

Set a selected canonical base and refresh Resource compatibility fields.

在文件 WeaponAttributes.cpp 第 103 行定义.

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

◆ snapshot()

eve::Result< eve::attributes::AttributeProjectionSnapshot > eve::weapon::WeaponAttributeAdapter::snapshot ( WeaponEntity &  weapon)
static

Capture selected resource attributes with owner generation and revision.

在文件 WeaponAttributes.cpp 第 161 行定义.

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

类成员变量说明

◆ manaAttribute

constexpr std::string_view eve::weapon::WeaponAttributeAdapter::manaAttribute = "mana"
staticconstexpr

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

被这些函数引用 ensure().

◆ maxManaAttribute

constexpr std::string_view eve::weapon::WeaponAttributeAdapter::maxManaAttribute = "max_mana"
staticconstexpr

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

被这些函数引用 ensure().

◆ maxStaminaAttribute

constexpr std::string_view eve::weapon::WeaponAttributeAdapter::maxStaminaAttribute = "max_stamina"
staticconstexpr

在文件 WeaponAttributes.h 第 31 行定义.

被这些函数引用 ensure().

◆ staminaAttribute

constexpr std::string_view eve::weapon::WeaponAttributeAdapter::staminaAttribute = "stamina"
staticconstexpr

在文件 WeaponAttributes.h 第 30 行定义.

被这些函数引用 ensure().


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