载入中...
搜索中...
未找到
eve::attributes 命名空间参考

命名空间

namespace  priority
 Shared default priorities for domain adapters.
 
namespace  source
 Stable source labels used by all domain attribute adapters.
 

类

struct  AttributeModifier
 One canonical runtime modifier applied to one named attribute. 更多...
 
class  AttributeOperationRegistry
 Registry for explicitly named custom attribute policies. 更多...
 
class  AttributeProjection
 Canonical selected-attribute storage with owner and revision checks. 更多...
 
struct  AttributeProjectionSnapshot
 Transaction-safe snapshot of selected attributes and their modifiers. 更多...
 
class  AttributeResourceAccountAdapter
 Restricts one AttributeSetResourceAccount to Mana or Stamina. 更多...
 
class  Attributes
 Generic named numeric attributes and modifier module. 更多...
 
class  AttributeSet
 Generic owning collection of canonical attributes and modifiers. 更多...
 
class  AttributeSetResourceAccount
 Adapts integral AttributeSet base values to IResourceAccount. 更多...
 
class  AttributeSetStateAdapter
 Adapts one AttributeSet to numeric world reads and volatile writes. 更多...
 
struct  AttributeSnapshotBase
 One base value captured by an attribute projection snapshot. 更多...
 
struct  AttributeValue
 Runtime value and modifiers for exactly one attribute. 更多...
 
struct  ParsedAttributeOperation
 Parsed legacy operation and its normalized value. 更多...
 

类型定义

using ManaAccountAdapter = AttributeResourceAccountAdapter
 Explicit alias used by code that wants a Mana-only view.
 
using StaminaAccountAdapter = AttributeResourceAccountAdapter
 Explicit alias used by code that wants a Stamina-only view.
 
using AttributeId = std::string
 
using ModifierId = std::string
 
using SourceId = std::string
 
using ModifierPriority = std::int32_t
 
using ModifierSequence = std::uint64_t
 

枚举

enum class  AttributeResourceKind : unsigned char { Mana , Stamina }
 Attribute-backed resource names used by common gameplay adapters. 更多...
 
enum class  AttributeOperation : std::uint8_t {
  Add , AdditivePercent , MultiplicativePercent , Override ,
  ClampMin , ClampMax , Custom
}
 Built-in calculation operation for an attribute modifier. 更多...
 

函数

 Module_IMPL (Attributes, new Attributes())
 
const char * attributeOperationName (AttributeOperation operation) noexcept
 Stable spelling of a built-in attribute operation. @ownership The returned string is a borrowed, process-static literal; the caller must not free or retain it as mutable storage. @nullable Never null for a valid enum value; the unknown-value spelling is also a process-static literal for an invalid value. @lifetime Valid for the process lifetime. @thread Thread-safe because the function reads no mutable state. @reentrancy Reentrant; it performs no callbacks.
 
eve::Result< ParsedAttributeOperation > parseAttributeOperation (std::string_view operation, double value)
 Parse a built-in operation spelling used by existing data and APIs.
 
double computeAttributeValue (const AttributeValue &attribute, const AttributeOperationRegistry *customOperations=nullptr)
 Compute one attribute using the canonical operation order.
 

类型定义说明

◆ AttributeId

using eve::attributes::AttributeId = typedef std::string

在文件 AttributeSet.h 第 18 行定义.

◆ ManaAccountAdapter

Explicit alias used by code that wants a Mana-only view.

在文件 AttributeResourceAccount.h 第 93 行定义.

◆ ModifierId

using eve::attributes::ModifierId = typedef std::string

在文件 AttributeSet.h 第 19 行定义.

◆ ModifierPriority

using eve::attributes::ModifierPriority = typedef std::int32_t

在文件 AttributeSet.h 第 21 行定义.

◆ ModifierSequence

using eve::attributes::ModifierSequence = typedef std::uint64_t

在文件 AttributeSet.h 第 22 行定义.

◆ SourceId

using eve::attributes::SourceId = typedef std::string

在文件 AttributeSet.h 第 20 行定义.

◆ StaminaAccountAdapter

Explicit alias used by code that wants a Stamina-only view.

在文件 AttributeResourceAccount.h 第 95 行定义.

枚举类型说明

◆ AttributeOperation

enum class eve::attributes::AttributeOperation : std::uint8_t
strong

Built-in calculation operation for an attribute modifier.

枚举值
Add 
AdditivePercent 
MultiplicativePercent 
Override 
ClampMin 
ClampMax 
Custom 

在文件 AttributeSet.h 第 25 行定义.

◆ AttributeResourceKind

enum class eve::attributes::AttributeResourceKind : unsigned char
strong

Attribute-backed resource names used by common gameplay adapters.

枚举值
Mana 
Stamina 

在文件 AttributeResourceAccount.h 第 17 行定义.

函数说明

◆ attributeOperationName()

const char * eve::attributes::attributeOperationName ( AttributeOperation  operation)
noexcept

Stable spelling of a built-in attribute operation. @ownership The returned string is a borrowed, process-static literal; the caller must not free or retain it as mutable storage. @nullable Never null for a valid enum value; the unknown-value spelling is also a process-static literal for an invalid value. @lifetime Valid for the process lifetime. @thread Thread-safe because the function reads no mutable state. @reentrancy Reentrant; it performs no callbacks.

在文件 AttributeSet.cpp 第 21 行定义.

引用了 Add, AdditivePercent, ClampMax, ClampMin, Custom, MultiplicativePercent, operation , 以及 Override.

◆ computeAttributeValue()

EVENGINE_API_FOUNDATION double eve::attributes::computeAttributeValue ( const AttributeValue &  attribute,
const AttributeOperationRegistry *  customOperations = nullptr 
)

Compute one attribute using the canonical operation order.

The order is base, all Add values, one summed AdditivePercent pass, all MultiplicativePercent factors, then priority/sequence ordered Override and Clamp operations. Custom policies participate in the final ordered phase.

在文件 AttributeSet.cpp 第 104 行定义.

引用了 Add, AdditivePercent, eve::attributes::AttributeOperationRegistry::apply(), eve::attributes::AttributeValue::base, ClampMax, ClampMin, Custom, eve::attributes::AttributeOperationRegistry::has(), left, eve::attributes::AttributeValue::modifiers, MultiplicativePercent, Override , 以及 right.

被这些函数引用 eve::attributes::AttributeSet::getFinal().

◆ Module_IMPL()

eve::attributes::Module_IMPL ( Attributes  ,
new   Attributes() 
)

◆ parseAttributeOperation()

EVENGINE_API_FOUNDATION eve::Result< ParsedAttributeOperation > eve::attributes::parseAttributeOperation ( std::string_view  operation,
double  value 
)

Parse a built-in operation spelling used by existing data and APIs.

返回
A normalized operation, or a rejected Result for an unknown spelling.

在文件 AttributeSet.cpp 第 34 行定义.

引用了 Add, AdditivePercent, ClampMax, ClampMin, eve::Result< T >::failure(), MultiplicativePercent, operation, eve::attributes::ParsedAttributeOperation::operation, Override, eve::Result< T >::success(), value , 以及 eve::attributes::ParsedAttributeOperation::value.

被这些函数引用 eve::attributes::AttributeSet::addModifier() , 以及 eve::rpg::AttributeSystem::addModifier().