载入中...
搜索中...
未找到
eve::rpg::SkillDefinitionRuntime类 参考final

Typed SkillDefinition-to-runtime adapter. 更多...

#include <SkillDefinitionRuntime.h>

Public 成员函数

 SkillDefinitionRuntime (SkillDefinitionRuntime &&) noexcept=default
 Skill definition runtime.
 
SkillDefinitionRuntime & operator= (SkillDefinitionRuntime &&) noexcept=default
 Operator =.
 
 SkillDefinitionRuntime (const SkillDefinitionRuntime &)=delete
 
SkillDefinitionRuntime & operator= (const SkillDefinitionRuntime &)=delete
 
 ~SkillDefinitionRuntime ()=default
 Skill definition runtime.
 
const eve::definition::InstanceIdentity & identity () const noexcept
 Borrow the common identity, including exact definition generation.
 
const SkillRuntimeState & state () const noexcept
 Borrow mutable per-instance skill state.
 
SkillRuntimeState & state () noexcept
 Mutate per-instance state on the owner thread.
 
eve::definition::DefinitionHandle definitionHandle () const noexcept
 Return the exact generation-qualified definition handle.
 
eve::Result< SkillDefinition > definition () const
 Resolve and parse the current typed definition projection.
 
eve::definition::ReloadPolicy reloadPolicy () const noexcept
 Return the configured reload policy.
 
void setActive (bool active) noexcept
 Set the active-cast guard used by RejectWhileActive.
 
bool isActive () const noexcept
 Return whether this skill is currently active.
 
eve::Result< void > applyTo (RPGActor *actor) const
 Project this skill instance into an RPGActor's Skills component.
 
eve::Result< eve::definition::ReloadOutcome > reload (eve::definition::ReloadPolicy policy)
 Reload the current registry generation using a typed policy.
 
eve::Result< eve::SnapshotEnvelope > snapshot (eve::Revision revision, eve::SimulationTick tick, const eve::SnapshotHashProvider &hashProvider) const
 Capture this skill's instance state in a common SnapshotEnvelope.
 
eve::Result< std::string > snapshotJson (eve::Revision revision, eve::SimulationTick tick, const eve::SnapshotHashProvider &hashProvider) const
 Serialize snapshot() as canonical JSON.
 
eve::Result< void > restore (const eve::SnapshotEnvelope &snapshot, const eve::SnapshotHashProvider &hashProvider)
 Verify and restore a same-generation skill snapshot atomically.
 

静态 Public 成员函数

static eve::Result< SkillDefinitionRuntime > create (eve::definitions::DefinitionRegistry &registry, eve::DefinitionRef definition, eve::PersistentId instanceId, eve::definition::ReloadPolicy policy=eve::definition::ReloadPolicy::RebuildInstance)
 Create a runtime from a generation-qualified common definition.
 
static eve::Result< SkillDefinitionRuntime > create (eve::PersistentId instanceId, std::string_view skillId, eve::definition::ReloadPolicy policy=eve::definition::ReloadPolicy::RebuildInstance)
 Create from the canonical legacy SkillRegistry facade.
 

详细描述

Typed SkillDefinition-to-runtime adapter.

The registry is borrowed and must outlive this object. All methods are synchronous and owner-thread affine. RebuildInstance is the default policy: it adopts the new typed definition while retaining a valid cooldown/learned state. RejectWhileActive uses the adapter active flag; callers set it while a cast session owns the skill.

在文件 SkillDefinitionRuntime.h 第 42 行定义.

构造及析构函数说明

◆ SkillDefinitionRuntime() [1/2]

eve::rpg::SkillDefinitionRuntime::SkillDefinitionRuntime ( SkillDefinitionRuntime &&  )
defaultnoexcept

Skill definition runtime.

◆ SkillDefinitionRuntime() [2/2]

eve::rpg::SkillDefinitionRuntime::SkillDefinitionRuntime ( const SkillDefinitionRuntime &  )
delete

◆ ~SkillDefinitionRuntime()

eve::rpg::SkillDefinitionRuntime::~SkillDefinitionRuntime ( )
default

Skill definition runtime.

成员函数说明

◆ applyTo()

eve::Result< void > eve::rpg::SkillDefinitionRuntime::applyTo ( RPGActor *  actor) const

Project this skill instance into an RPGActor's Skills component.

参数
actorBorrowed ECS actor; no pointer is retained.
返回
Success or InvalidArgument; projection is committed as one component swap.

在文件 SkillDefinitionRuntime.cpp 第 266 行定义.

引用了 eve::rpg::SkillRuntimeState::cooldownRemaining, definition(), eve::Diagnostic::error(), eve::Result< T >::failure(), id, identity(), eve::InvalidArgument, state() , 以及 eve::Result< T >::success().

◆ create() [1/2]

Create a runtime from a generation-qualified common definition.

参数
registryBorrowed registry containing a rpg.skill:<name> entry.
definitionLogical skill definition reference.
instanceIdNon-nil persistent identity of this learned skill.
policyReload policy used by subsequent reload calls.
返回
A typed adapter or a structured resolution/validation failure.

在文件 SkillDefinitionRuntime.cpp 第 206 行定义.

引用了 eve::definition::RuntimeInstance< State >::create(), definition(), eve::Diagnostic::error(), eve::Result< T >::failure(), handle, eve::InvalidArgument, eve::definitions::DefinitionRegistry::resolveHandle() , 以及 eve::Result< T >::success().

被这些函数引用 create().

◆ create() [2/2]

◆ definition()

eve::Result< SkillDefinition > eve::rpg::SkillDefinitionRuntime::definition ( ) const

Resolve and parse the current typed definition projection.

在文件 SkillDefinitionRuntime.cpp 第 252 行定义.

引用了 definitionHandle(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 eve::definitions::DefinitionRegistry::resolveHandle().

被这些函数引用 applyTo(), create(), reload() , 以及 restore().

◆ definitionHandle()

eve::definition::DefinitionHandle eve::rpg::SkillDefinitionRuntime::definitionHandle ( ) const
noexcept

Return the exact generation-qualified definition handle.

在文件 SkillDefinitionRuntime.cpp 第 248 行定义.

被这些函数引用 definition() , 以及 restore().

◆ identity()

const eve::definition::InstanceIdentity & eve::rpg::SkillDefinitionRuntime::identity ( ) const
noexcept

Borrow the common identity, including exact definition generation.

在文件 SkillDefinitionRuntime.cpp 第 240 行定义.

被这些函数引用 applyTo(), reload() , 以及 restore().

◆ isActive()

bool eve::rpg::SkillDefinitionRuntime::isActive ( ) const
noexcept

Return whether this skill is currently active.

在文件 SkillDefinitionRuntime.cpp 第 264 行定义.

◆ operator=() [1/2]

SkillDefinitionRuntime & eve::rpg::SkillDefinitionRuntime::operator= ( const SkillDefinitionRuntime &  )
delete

◆ operator=() [2/2]

SkillDefinitionRuntime & eve::rpg::SkillDefinitionRuntime::operator= ( SkillDefinitionRuntime &&  )
defaultnoexcept

Operator =.

◆ reload()

◆ reloadPolicy()

eve::definition::ReloadPolicy eve::rpg::SkillDefinitionRuntime::reloadPolicy ( ) const
inlinenoexcept

Return the configured reload policy.

在文件 SkillDefinitionRuntime.h 第 81 行定义.

◆ restore()

eve::Result< void > eve::rpg::SkillDefinitionRuntime::restore ( const eve::SnapshotEnvelope &  snapshot,
const eve::SnapshotHashProvider &  hashProvider 
)

Verify and restore a same-generation skill snapshot atomically.

返回
Success, or schema/hash/definition/stale/decode failure; state remains unchanged on every failure.

在文件 SkillDefinitionRuntime.cpp 第 323 行定义.

引用了 current, definition(), definitionHandle(), eve::Diagnostic::error(), eve::Result< T >::failure(), identity(), eve::InvalidArgument, eve::definition::restoreRuntimeInstance() , 以及 eve::StaleHandle.

◆ setActive()

void eve::rpg::SkillDefinitionRuntime::setActive ( bool  active)
noexcept

Set the active-cast guard used by RejectWhileActive.

在文件 SkillDefinitionRuntime.cpp 第 262 行定义.

引用了 active.

◆ snapshot()

eve::Result< eve::SnapshotEnvelope > eve::rpg::SkillDefinitionRuntime::snapshot ( eve::Revision  revision,
eve::SimulationTick  tick,
const eve::SnapshotHashProvider &  hashProvider 
) const

Capture this skill's instance state in a common SnapshotEnvelope.

参数
revisionDomain revision associated with the capture.
tickDeterministic simulation tick associated with the capture.
hashProviderExplicit content digest provider.
返回
A sealed snapshot or a structured failure.

在文件 SkillDefinitionRuntime.cpp 第 306 行定义.

引用了 revision, eve::definition::snapshotRuntimeInstance(), eve::Result< T >::success(), tick , 以及 value.

被这些函数引用 snapshotJson().

◆ snapshotJson()

eve::Result< std::string > eve::rpg::SkillDefinitionRuntime::snapshotJson ( eve::Revision  revision,
eve::SimulationTick  tick,
const eve::SnapshotHashProvider &  hashProvider 
) const

Serialize snapshot() as canonical JSON.

在文件 SkillDefinitionRuntime.cpp 第 315 行定义.

引用了 eve::Result< T >::failure(), revision, eve::serializeSnapshotEnvelope(), snapshot(), tick , 以及 value.

◆ state() [1/2]

const SkillRuntimeState & eve::rpg::SkillDefinitionRuntime::state ( ) const
noexcept

Borrow mutable per-instance skill state.

在文件 SkillDefinitionRuntime.cpp 第 244 行定义.

被这些函数引用 applyTo().

◆ state() [2/2]

SkillRuntimeState & eve::rpg::SkillDefinitionRuntime::state ( )
noexcept

Mutate per-instance state on the owner thread.

在文件 SkillDefinitionRuntime.cpp 第 246 行定义.


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