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 ®istry, 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]
|
defaultnoexcept |
Skill definition runtime.
◆ SkillDefinitionRuntime() [2/2]
|
delete |
◆ ~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.
- 参数
-
actor Borrowed 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]
|
static |
Create a runtime from a generation-qualified common definition.
- 参数
-
registry Borrowed registry containing a rpg.skill:<name>entry.definition Logical skill definition reference. instanceId Non-nil persistent identity of this learned skill. policy Reload 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]
|
static |
Create from the canonical legacy SkillRegistry facade.
在文件 SkillDefinitionRuntime.cpp 第 227 行定义.
引用了 create(), eve::rpg::SkillRegistry::definitionRegistry(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::DefinitionRef::fromId(), eve::LogicalId::fromParts(), eve::InvalidArgument , 以及 reference.
◆ 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().
◆ definitionHandle()
|
noexcept |
Return the exact generation-qualified definition handle.
在文件 SkillDefinitionRuntime.cpp 第 248 行定义.
被这些函数引用 definition() , 以及 restore().
◆ identity()
|
noexcept |
Borrow the common identity, including exact definition generation.
在文件 SkillDefinitionRuntime.cpp 第 240 行定义.
◆ isActive()
|
noexcept |
Return whether this skill is currently active.
在文件 SkillDefinitionRuntime.cpp 第 264 行定义.
◆ operator=() [1/2]
|
delete |
◆ operator=() [2/2]
|
defaultnoexcept |
Operator =.
◆ reload()
| eve::Result< eve::definition::ReloadOutcome > eve::rpg::SkillDefinitionRuntime::reload | ( | eve::definition::ReloadPolicy | policy | ) |
Reload the current registry generation using a typed policy.
在文件 SkillDefinitionRuntime.cpp 第 282 行定义.
引用了 eve::rpg::SkillRuntimeState::cooldownRemaining, definition(), eve::Diagnostic::error(), eve::Result< T >::failure(), identity(), eve::InvalidArgument, eve::definitions::DefinitionRegistry::resolveHandle() , 以及 eve::Result< T >::success().
◆ reloadPolicy()
|
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()
|
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.
- 参数
-
revision Domain revision associated with the capture. tick Deterministic simulation tick associated with the capture. hashProvider Explicit 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]
|
noexcept |
Borrow mutable per-instance skill state.
在文件 SkillDefinitionRuntime.cpp 第 244 行定义.
被这些函数引用 applyTo().
◆ state() [2/2]
|
noexcept |
Mutate per-instance state on the owner thread.
在文件 SkillDefinitionRuntime.cpp 第 246 行定义.
该类的文档由以下文件生成:
- src/modules/rpg/SkillDefinitionRuntime.h
- src/modules/rpg/SkillDefinitionRuntime.cpp