Defines the small set of RTS unit stats eligible for attributes. 更多...
#include <RTSAttributes.h>
静态 Public 成员函数 | |
| static eve::Result< void > | ensure (Unit &unit) |
| Bind and seed default optional combat stats exactly once. | |
| static eve::Result< double > | read (Unit &unit, std::string_view attribute) |
| Read one selected combat stat. | |
| static eve::Result< void > | setBase (Unit &unit, std::string_view attribute, double value) |
| Set one selected canonical base stat. | |
| static eve::Result< eve::attributes::ModifierId > | addModifier (Unit &unit, 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< eve::attributes::AttributeProjectionSnapshot > | snapshot (Unit &unit) |
| Capture selected unit combat stats with owner generation and revision. | |
| static eve::Result< void > | restore (Unit &unit, const eve::attributes::AttributeProjectionSnapshot &snapshot, eve::Revision expectedRevision) |
| Restore selected unit combat stats after owner/revision checks. | |
静态 Public 属性 | |
| static constexpr std::string_view | attackAttribute = "attack" |
| static constexpr std::string_view | healthAttribute = "health" |
| static constexpr std::string_view | maxHealthAttribute = "max_health" |
| static constexpr std::string_view | armorAttribute = "armor" |
详细描述
Defines the small set of RTS unit stats eligible for attributes.
Attack, health, max_health and armor are optional combat facts. Unit position, speed, arrival radius, formation coordinates and order state stay in their dedicated components and are never copied into AttributeSet.
在文件 RTSAttributes.h 第 26 行定义.
成员函数说明
◆ addModifier()
|
static |
Add a modifier using the shared operation/priority/sequence contract.
在文件 RTSAttributes.cpp 第 65 行定义.
引用了 ensure(), eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Status::failure(), eve::InvalidArgument, operation, priority, source, unit , 以及 value.
◆ ensure()
|
static |
Bind and seed default optional combat stats exactly once.
在文件 RTSAttributes.cpp 第 24 行定义.
引用了 armorAttribute, attackAttribute, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Status::failure(), healthAttribute, maxHealthAttribute, eve::NoOp, eve::Status::success(), eve::Result< T >::success() , 以及 unit.
被这些函数引用 addModifier(), eve::rts::RTS::newUnit(), read(), restore(), setBase() , 以及 snapshot().
◆ read()
|
static |
Read one selected combat stat.
在文件 RTSAttributes.cpp 第 42 行定义.
引用了 ensure(), eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Status::failure(), unit , 以及 eve::Unsupported.
◆ restore()
|
static |
Restore selected unit combat stats after owner/revision checks.
在文件 RTSAttributes.cpp 第 91 行定义.
引用了 ensure(), eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Status::failure() , 以及 unit.
被这些函数引用 eve::rts::RTS::restoreState().
◆ setBase()
|
static |
Set one selected canonical base stat.
在文件 RTSAttributes.cpp 第 55 行定义.
引用了 ensure(), eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Status::failure(), unit, eve::Unsupported , 以及 value.
◆ snapshot()
|
static |
Capture selected unit combat stats with owner generation and revision.
在文件 RTSAttributes.cpp 第 81 行定义.
引用了 ensure(), eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Status::failure() , 以及 unit.
被这些函数引用 eve::rts::RTS::restoreState().
类成员变量说明
◆ armorAttribute
|
staticconstexpr |
在文件 RTSAttributes.h 第 31 行定义.
被这些函数引用 ensure().
◆ attackAttribute
|
staticconstexpr |
在文件 RTSAttributes.h 第 28 行定义.
被这些函数引用 ensure().
◆ healthAttribute
|
staticconstexpr |
在文件 RTSAttributes.h 第 29 行定义.
被这些函数引用 ensure().
◆ maxHealthAttribute
|
staticconstexpr |
在文件 RTSAttributes.h 第 30 行定义.
被这些函数引用 ensure().
该类的文档由以下文件生成:
- src/modules/rts/RTSAttributes.h
- src/modules/rts/RTSAttributes.cpp