载入中...
搜索中...
未找到
eve::card::CardDefinitionRuntime类 参考final

Binds a typed card runtime to one Definitions registry incarnation. 更多...

#include <CardDefinitionRuntime.h>

Public 成员函数

 CardDefinitionRuntime (CardDefinitionRuntime &&) noexcept=default
 Move a card runtime while retaining its borrowed registry binding.
 
CardDefinitionRuntime & operator= (CardDefinitionRuntime &&) noexcept=default
 Move-assign a card runtime.
 
 CardDefinitionRuntime (const CardDefinitionRuntime &)=delete
 Card runtimes are not implicitly copyable.
 
CardDefinitionRuntime & operator= (const CardDefinitionRuntime &)=delete
 Card runtimes are not implicitly copy-assignable.
 
 ~CardDefinitionRuntime ()=default
 Destroy the card runtime; the registry remains caller-owned.
 
const eve::definition::InstanceIdentity & identity () const noexcept
 Borrow the unified instance identity.
 
const CardRuntimeState & state () const noexcept
 Borrow the strongly typed card runtime state.
 
CardRuntimeState & state () noexcept
 Mutate the strongly typed card runtime state on the owner thread.
 
eve::definition::DefinitionHandle definitionHandle () const noexcept
 Borrow the exact generation-qualified definition handle.
 
eve::definition::ReloadPolicy reloadPolicy () const noexcept
 Return the policy used by the next reload call.
 
void setActive (bool active) noexcept
 Mark the instance active/inactive for RejectWhileActive.
 
bool isActive () const noexcept
 Return whether RejectWhileActive currently treats the instance as active.
 
eve::Result< void > applyTo (CardData *card) const
 Apply the typed state and common identity to an ECS CardData.
 
eve::Result< eve::definition::ReloadOutcome > reload (eve::definition::ReloadPolicy policy)
 Reload from the registry's current generation and execute policy.
 
eve::Result< eve::SnapshotEnvelope > snapshot (eve::Revision revision, eve::SimulationTick tick, const eve::SnapshotHashProvider &hashProvider) const
 Capture card instance state in the 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 atomically restore a same-generation card snapshot.
 

静态 Public 成员函数

static eve::Result< CardDefinitionRuntime > create (eve::definitions::DefinitionRegistry &registry, eve::DefinitionRef definition, eve::PersistentId instanceId, eve::definition::ReloadPolicy policy=eve::definition::ReloadPolicy::KeepInstanceValues)
 Create a card runtime from the current typed definition.
 

详细描述

Binds a typed card runtime to one Definitions registry incarnation.

The registry is borrowed and must outlive this adapter. CardData remains the ECS/presentation object; this adapter owns the definition-bound typed state and projects it into CardData through applyTo. All methods are owner-thread affine and synchronous. Reload prepares the complete typed state before changing its identity; a failure leaves both unchanged.

在文件 CardDefinitionRuntime.h 第 48 行定义.

构造及析构函数说明

◆ CardDefinitionRuntime() [1/2]

eve::card::CardDefinitionRuntime::CardDefinitionRuntime ( CardDefinitionRuntime &&  )
defaultnoexcept

Move a card runtime while retaining its borrowed registry binding.

◆ CardDefinitionRuntime() [2/2]

eve::card::CardDefinitionRuntime::CardDefinitionRuntime ( const CardDefinitionRuntime &  )
delete

Card runtimes are not implicitly copyable.

◆ ~CardDefinitionRuntime()

eve::card::CardDefinitionRuntime::~CardDefinitionRuntime ( )
default

Destroy the card runtime; the registry remains caller-owned.

成员函数说明

◆ applyTo()

◆ create()

Create a card runtime from the current typed definition.

参数
registryRegistry whose lifetime exceeds this adapter.
definitionLogical card:<name> reference.
instanceIdNon-nil persistent identity for this card instance.
返回
A typed runtime or a structured resolution/parse failure.

在文件 CardDefinitionRuntime.cpp 第 216 行定义.

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

◆ definitionHandle()

eve::definition::DefinitionHandle eve::card::CardDefinitionRuntime::definitionHandle ( ) const
noexcept

Borrow the exact generation-qualified definition handle.

在文件 CardDefinitionRuntime.cpp 第 243 行定义.

被这些函数引用 restore().

◆ identity()

const eve::definition::InstanceIdentity & eve::card::CardDefinitionRuntime::identity ( ) const
noexcept

Borrow the unified instance identity.

在文件 CardDefinitionRuntime.cpp 第 235 行定义.

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

◆ isActive()

bool eve::card::CardDefinitionRuntime::isActive ( ) const
noexcept

Return whether RejectWhileActive currently treats the instance as active.

在文件 CardDefinitionRuntime.cpp 第 249 行定义.

被这些函数引用 applyTo().

◆ operator=() [1/2]

CardDefinitionRuntime & eve::card::CardDefinitionRuntime::operator= ( CardDefinitionRuntime &&  )
defaultnoexcept

Move-assign a card runtime.

◆ operator=() [2/2]

CardDefinitionRuntime & eve::card::CardDefinitionRuntime::operator= ( const CardDefinitionRuntime &  )
delete

Card runtimes are not implicitly copy-assignable.

◆ reload()

eve::Result< eve::definition::ReloadOutcome > eve::card::CardDefinitionRuntime::reload ( eve::definition::ReloadPolicy  policy)

Reload from the registry's current generation and execute policy.

参数
policyPolicy to execute for this card instance.
返回
A typed reload outcome, or a stale/parse/policy failure. On failure the adapter state and generation remain unchanged.

在文件 CardDefinitionRuntime.cpp 第 281 行定义.

引用了 eve::card::CardRuntimeState::currentHealth, eve::Diagnostic::error(), eve::Result< T >::failure(), identity(), eve::InvalidArgument, eve::card::CardRuntimeState::maxHealth , 以及 eve::Result< T >::success().

◆ reloadPolicy()

eve::definition::ReloadPolicy eve::card::CardDefinitionRuntime::reloadPolicy ( ) const
inlinenoexcept

Return the policy used by the next reload call.

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

◆ restore()

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

◆ setActive()

void eve::card::CardDefinitionRuntime::setActive ( bool  active)
noexcept

Mark the instance active/inactive for RejectWhileActive.

在文件 CardDefinitionRuntime.cpp 第 247 行定义.

引用了 active.

◆ snapshot()

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

Capture card instance state in the common SnapshotEnvelope.

在文件 CardDefinitionRuntime.cpp 第 302 行定义.

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

被这些函数引用 snapshotJson().

◆ snapshotJson()

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

Serialize snapshot() as canonical JSON.

在文件 CardDefinitionRuntime.cpp 第 311 行定义.

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

◆ state() [1/2]

const CardRuntimeState & eve::card::CardDefinitionRuntime::state ( ) const
noexcept

Borrow the strongly typed card runtime state.

在文件 CardDefinitionRuntime.cpp 第 239 行定义.

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

◆ state() [2/2]

CardRuntimeState & eve::card::CardDefinitionRuntime::state ( )
noexcept

Mutate the strongly typed card runtime state on the owner thread.

在文件 CardDefinitionRuntime.cpp 第 241 行定义.


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