载入中...
搜索中...
未找到
eve::vehicle::VehicleDefinitionRuntime类 参考final

Binds a VehicleDefinition to a VehicleEntity without a new root type. 更多...

#include <VehicleDefinitionRuntime.h>

Public 成员函数

 VehicleDefinitionRuntime (VehicleDefinitionRuntime &&) noexcept=default
 Vehicle definition runtime.
 
VehicleDefinitionRuntime & operator= (VehicleDefinitionRuntime &&) noexcept=default
 Operator =.
 
 VehicleDefinitionRuntime (const VehicleDefinitionRuntime &)=delete
 
VehicleDefinitionRuntime & operator= (const VehicleDefinitionRuntime &)=delete
 
 ~VehicleDefinitionRuntime ()=default
 Vehicle definition runtime.
 
const eve::definition::InstanceIdentity & identity () const noexcept
 Borrow common instance identity and exact definition generation.
 
const VehicleRuntimeState & state () const noexcept
 Borrow mutable vehicle entity state.
 
VehicleRuntimeState & state () noexcept
 Mutate vehicle state on the owner thread.
 
eve::definition::DefinitionHandle definitionHandle () const noexcept
 Return the generation-qualified definition handle.
 
eve::Result< VehicleDefinition > definition () const
 Resolve and parse the current strongly typed VehicleDefinition.
 
eve::definition::ReloadPolicy reloadPolicy () const noexcept
 Return the reload policy used by the next reload.
 
void setActive (bool active) noexcept
 Set the active guard used by RejectWhileActive.
 
bool isActive () const noexcept
 Return the active guard state.
 
eve::Result< void > applyTo (VehicleEntity *entity) const
 Project typed state and identity into a borrowed VehicleEntity.
 
eve::Result< eve::definition::ReloadOutcome > reload (eve::definition::ReloadPolicy policy)
 Reload the registry's current generation using a typed policy.
 
eve::Result< eve::SnapshotEnvelope > snapshot (eve::Revision revision, eve::SimulationTick tick, const eve::SnapshotHashProvider &hashProvider) const
 Capture mutable entity 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 deterministic JSON.
 
eve::Result< void > restore (const eve::SnapshotEnvelope &snapshot, const eve::SnapshotHashProvider &hashProvider)
 Verify and restore a same-generation vehicle snapshot atomically.
 

静态 Public 成员函数

static eve::Result< VehicleDefinitionRuntime > create (eve::definitions::DefinitionRegistry &registry, eve::DefinitionRef definition, eve::PersistentId instanceId, eve::definition::ReloadPolicy policy=eve::definition::ReloadPolicy::RebuildInstance)
 Create from a common vehicle:<name> definition.
 
static eve::Result< VehicleDefinitionRuntime > create (eve::definitions::DefinitionRegistry &registry, std::string_view definitionId, eve::PersistentId instanceId, eve::definition::ReloadPolicy policy=eve::definition::ReloadPolicy::RebuildInstance)
 Create from a Vehicle module's canonical definition registry.
 
static eve::Result< VehicleDefinitionRuntime > create (Vehicle &module, std::string_view definitionId, eve::PersistentId instanceId, eve::definition::ReloadPolicy policy=eve::definition::ReloadPolicy::RebuildInstance)
 Create through the existing Vehicle module facade.
 

详细描述

Binds a VehicleDefinition to a VehicleEntity without a new root type.

The registry is borrowed and must outlive synchronous calls. applyTo installs an immutable definition projection into the entity component and writes the mutable ECS components in one candidate swap. Vehicle physics, weapons and orders remain links/components owned by their own domains.

在文件 VehicleDefinitionRuntime.h 第 56 行定义.

构造及析构函数说明

◆ VehicleDefinitionRuntime() [1/2]

eve::vehicle::VehicleDefinitionRuntime::VehicleDefinitionRuntime ( VehicleDefinitionRuntime &&  )
defaultnoexcept

Vehicle definition runtime.

◆ VehicleDefinitionRuntime() [2/2]

eve::vehicle::VehicleDefinitionRuntime::VehicleDefinitionRuntime ( const VehicleDefinitionRuntime &  )
delete

◆ ~VehicleDefinitionRuntime()

eve::vehicle::VehicleDefinitionRuntime::~VehicleDefinitionRuntime ( )
default

Vehicle definition runtime.

成员函数说明

◆ applyTo()

◆ create() [1/3]

◆ create() [2/3]

eve::Result< VehicleDefinitionRuntime > eve::vehicle::VehicleDefinitionRuntime::create ( eve::definitions::DefinitionRegistry &  registry,
std::string_view  definitionId,
eve::PersistentId  instanceId,
eve::definition::ReloadPolicy  policy = eve::definition::ReloadPolicy::RebuildInstance 
)
static

◆ create() [3/3]

eve::Result< VehicleDefinitionRuntime > eve::vehicle::VehicleDefinitionRuntime::create ( Vehicle &  module,
std::string_view  definitionId,
eve::PersistentId  instanceId,
eve::definition::ReloadPolicy  policy = eve::definition::ReloadPolicy::RebuildInstance 
)
static

Create through the existing Vehicle module facade.

在文件 VehicleDefinitionRuntime.cpp 第 395 行定义.

引用了 create() , 以及 eve::vehicle::Vehicle::definitionRegistry().

◆ definition()

eve::Result< VehicleDefinition > eve::vehicle::VehicleDefinitionRuntime::definition ( ) const

◆ definitionHandle()

eve::definition::DefinitionHandle eve::vehicle::VehicleDefinitionRuntime::definitionHandle ( ) const
noexcept

Return the generation-qualified definition handle.

在文件 VehicleDefinitionRuntime.cpp 第 409 行定义.

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

◆ identity()

const eve::definition::InstanceIdentity & eve::vehicle::VehicleDefinitionRuntime::identity ( ) const
noexcept

Borrow common instance identity and exact definition generation.

在文件 VehicleDefinitionRuntime.cpp 第 401 行定义.

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

◆ isActive()

bool eve::vehicle::VehicleDefinitionRuntime::isActive ( ) const
noexcept

Return the active guard state.

在文件 VehicleDefinitionRuntime.cpp 第 425 行定义.

被这些函数引用 applyTo().

◆ operator=() [1/2]

VehicleDefinitionRuntime & eve::vehicle::VehicleDefinitionRuntime::operator= ( const VehicleDefinitionRuntime &  )
delete

◆ operator=() [2/2]

VehicleDefinitionRuntime & eve::vehicle::VehicleDefinitionRuntime::operator= ( VehicleDefinitionRuntime &&  )
defaultnoexcept

Operator =.

◆ reload()

◆ reloadPolicy()

eve::definition::ReloadPolicy eve::vehicle::VehicleDefinitionRuntime::reloadPolicy ( ) const
inlinenoexcept

Return the reload policy used by the next reload.

在文件 VehicleDefinitionRuntime.h 第 96 行定义.

◆ restore()

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

Verify and restore a same-generation vehicle snapshot atomically.

返回
Failure leaves all mutable runtime state unchanged.

在文件 VehicleDefinitionRuntime.cpp 第 516 行定义.

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

◆ setActive()

void eve::vehicle::VehicleDefinitionRuntime::setActive ( bool  active)
noexcept

Set the active guard used by RejectWhileActive.

在文件 VehicleDefinitionRuntime.cpp 第 423 行定义.

引用了 active.

◆ snapshot()

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

Capture mutable entity state in a common SnapshotEnvelope.

在文件 VehicleDefinitionRuntime.cpp 第 499 行定义.

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

被这些函数引用 snapshotJson().

◆ snapshotJson()

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

Serialize snapshot() as canonical deterministic JSON.

在文件 VehicleDefinitionRuntime.cpp 第 508 行定义.

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

◆ state() [1/2]

const VehicleRuntimeState & eve::vehicle::VehicleDefinitionRuntime::state ( ) const
noexcept

Borrow mutable vehicle entity state.

在文件 VehicleDefinitionRuntime.cpp 第 405 行定义.

被这些函数引用 applyTo().

◆ state() [2/2]

VehicleRuntimeState & eve::vehicle::VehicleDefinitionRuntime::state ( )
noexcept

Mutate vehicle state on the owner thread.

在文件 VehicleDefinitionRuntime.cpp 第 407 行定义.


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