载入中...
搜索中...
未找到
eve::action::AbilityRuntime类 参考

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()

eve::action::AbilityRuntime::AbilityRuntime ( ActionRuntime &  runtime)
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.

参数
grantIdGranted ability selected by the caller.
requestFully owned request matching the definition's action id.
tickInjected 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()

Result< void > eve::action::AbilityRuntime::advanceCooldowns ( Duration  delta)

◆ 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 
)

◆ 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().


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