Owner-thread coordinator for grant and activation state. 更多...
#include <AbilitySystem.h>
Public 成员函数 | |
| AbilityRuntime (ActionRuntime &runtime) | |
| Construct a system borrowing the action runtime used for submissions. | |
| Result< void > | registerDefinition (AbilityDefinition definition) |
| Register one canonical definition; duplicate ids are rejected. | |
| Result< void > | replaceDefinition (AbilityDefinition definition) |
| Transactionally replace one registered definition for future activations. | |
| Result< AbilityGrantId > | grant (std::string ownerId, const LogicalId &definitionId) |
| Grant a registered definition to a non-empty owner identity. | |
| Result< void > | revoke (AbilityGrantId grantId) |
| Revoke an inactive grant. Active grants must be synchronized/cancelled first. | |
| Result< AbilityGrantState > | findGrant (AbilityGrantId grantId) const |
| Return an owning grant-state snapshot. | |
| Result< AbilityActivation > | activate (AbilityGrantId grantId, ActionRequest request, SimulationTick tick) |
| Submit an activation after cooldown, instancing and group checks. | |
| std::vector< AbilityGrantId > | matchingGrants (std::string_view ownerId, std::string_view gameplayEventTag) const |
| Return grants whose declared gameplay-event triggers match an event tag. | |
| Result< void > | advanceCooldowns (Duration delta) |
| Decrease every cooldown using injected deterministic time. | |
| Result< std::size_t > | synchronize () |
| Remove links whose ActionRuntime execution reached a terminal phase. | |
| std::vector< AbilityActivation > | activeActivations () const |
| Return owning active-link snapshots in activation-id order. | |
详细描述
Owner-thread coordinator for grant and activation state.
Definitions, grants, cooldowns and activation links have one owner here; ActionRuntime remains the sole owner of action phase state. The borrowed runtime must outlive this system. No method reads a clock or invokes scripts.
在文件 AbilitySystem.h 第 78 行定义.
构造及析构函数说明
◆ AbilityRuntime()
|
inlineexplicit |
Construct a system borrowing the action runtime used for submissions.
在文件 AbilitySystem.h 第 81 行定义.
成员函数说明
◆ activate()
| Result< AbilityActivation > eve::action::AbilityRuntime::activate | ( | AbilityGrantId | grantId, |
| ActionRequest | request, | ||
| SimulationTick | tick | ||
| ) |
Submit an activation after cooldown, instancing and group checks.
- 参数
-
grantId Granted ability selected by the caller. request Fully owned request matching the definition's action id. tick Injected deterministic tick used when replacing an exclusive activation.
在文件 AbilitySystem.cpp 第 105 行定义.
引用了 active, eve::Applied, eve::action::ActionRuntime::cancel(), eve::Conflict, eve::Diagnostic::error(), eve::action::ExclusiveBlocking, eve::Result< T >::failure(), eve::action::ActionRuntime::find(), grant(), eve::action::Independent, eve::InvalidArgument, eve::NotFound, eve::action::PerExecution, eve::action::PerOwner, eve::PreconditionViolation, request, eve::action::ActionRuntime::submit(), eve::Status::success(), eve::Result< T >::success(), tick, eve::detail::StrongUint64< Tag >::value() , 以及 eve::Duration::zero().
被这些函数引用 eve::action::AbilityControllerRuntime::processNext().
◆ activeActivations()
| std::vector< AbilityActivation > eve::action::AbilityRuntime::activeActivations | ( | ) | const |
Return owning active-link snapshots in activation-id order.
在文件 AbilitySystem.cpp 第 218 行定义.
◆ advanceCooldowns()
Decrease every cooldown using injected deterministic time.
在文件 AbilitySystem.cpp 第 196 行定义.
引用了 eve::Applied, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::Duration::fromNanoseconds(), grant(), eve::InvalidArgument, eve::Duration::isZero(), eve::Duration::nanoseconds(), eve::NoOp, eve::Status::success(), eve::Result< T >::success() , 以及 eve::Duration::zero().
◆ findGrant()
| Result< AbilityGrantState > eve::action::AbilityRuntime::findGrant | ( | AbilityGrantId | grantId | ) | const |
Return an owning grant-state snapshot.
在文件 AbilitySystem.cpp 第 97 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), found, eve::NotFound , 以及 eve::Result< T >::success().
◆ grant()
| Result< AbilityGrantId > eve::action::AbilityRuntime::grant | ( | std::string | ownerId, |
| const LogicalId & | definitionId | ||
| ) |
Grant a registered definition to a non-empty owner identity.
在文件 AbilitySystem.cpp 第 67 行定义.
引用了 eve::Applied, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::LogicalId::format(), eve::InvalidArgument, eve::NotFound, eve::action::PerOwner, state, eve::Status::success(), eve::Result< T >::success(), eve::detail::StrongUint64< Tag >::value() , 以及 eve::Duration::zero().
被这些函数引用 activate(), advanceCooldowns() , 以及 matchingGrants().
◆ matchingGrants()
| std::vector< AbilityGrantId > eve::action::AbilityRuntime::matchingGrants | ( | std::string_view | ownerId, |
| std::string_view | gameplayEventTag | ||
| ) | const |
Return grants whose declared gameplay-event triggers match an event tag.
在文件 AbilitySystem.cpp 第 180 行定义.
引用了 grant().
◆ registerDefinition()
| Result< void > eve::action::AbilityRuntime::registerDefinition | ( | AbilityDefinition | definition | ) |
Register one canonical definition; duplicate ids are rejected.
在文件 AbilitySystem.cpp 第 39 行定义.
引用了 eve::AlreadyExists, eve::Applied, eve::Diagnostic::error(), eve::Result< T >::failure(), key, eve::Status::success(), eve::Result< T >::success() , 以及 valid.
◆ replaceDefinition()
| Result< void > eve::action::AbilityRuntime::replaceDefinition | ( | AbilityDefinition | definition | ) |
Transactionally replace one registered definition for future activations.
Existing grants and cooldowns remain valid. Active ActionExecution objects retain the owning definition snapshot captured when they were submitted. A definition with grants cannot change its instancing policy.
在文件 AbilitySystem.cpp 第 49 行定义.
引用了 eve::Applied, eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), found, key, eve::NotFound, eve::Status::success(), eve::Result< T >::success() , 以及 valid.
◆ revoke()
| Result< void > eve::action::AbilityRuntime::revoke | ( | AbilityGrantId | grantId | ) |
Revoke an inactive grant. Active grants must be synchronized/cancelled first.
在文件 AbilitySystem.cpp 第 88 行定义.
引用了 eve::Applied, eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), found, eve::NotFound, eve::Status::success() , 以及 eve::Result< T >::success().
◆ synchronize()
| Result< std::size_t > eve::action::AbilityRuntime::synchronize | ( | ) |
Remove links whose ActionRuntime execution reached a terminal phase.
在文件 AbilitySystem.cpp 第 207 行定义.
引用了 eve::Applied, eve::action::ActionRuntime::find(), eve::NoOp, removed, eve::Status::success() , 以及 eve::Result< T >::success().
该类的文档由以下文件生成:
- src/modules/action/AbilitySystem.h
- src/modules/action/AbilitySystem.cpp