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 ®istry, 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 ®istry, 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]
|
defaultnoexcept |
Vehicle definition runtime.
◆ VehicleDefinitionRuntime() [2/2]
|
delete |
◆ ~VehicleDefinitionRuntime()
|
default |
Vehicle definition runtime.
成员函数说明
◆ applyTo()
| eve::Result< void > eve::vehicle::VehicleDefinitionRuntime::applyTo | ( | VehicleEntity * | entity | ) | const |
Project typed state and identity into a borrowed VehicleEntity.
- 返回
- Success or a structured projection failure; no state is changed when definition parsing or allocation fails.
在文件 VehicleDefinitionRuntime.cpp 第 427 行定义.
引用了 binding, eve::definition::InstanceIdentity::definition, definition(), eve::vehicle::VehicleRuntimeState::destroyed, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::detail::Id128< Tag >::format(), eve::vehicle::VehicleRuntimeState::heading, eve::DefinitionRef::id(), identity(), eve::definition::InstanceIdentity::instanceId, eve::InvalidArgument, isActive(), eve::LogicalId::name(), eve::vehicle::VehicleRuntimeState::speed, state(), eve::Result< T >::success(), eve::vehicle::VehicleRuntimeState::x , 以及 eve::vehicle::VehicleRuntimeState::y.
◆ create() [1/3]
|
static |
Create from a common vehicle:<name> definition.
- 返回
- A typed adapter or a structured parse/resolution failure.
在文件 VehicleDefinitionRuntime.cpp 第 358 行定义.
引用了 eve::definition::RuntimeInstance< State >::create(), definition(), eve::Diagnostic::error(), eve::Result< T >::failure(), handle, eve::vehicle::VehicleRuntimeState::health, eve::InvalidArgument, eve::vehicle::parseVehicleDefinition(), eve::definitions::DefinitionRegistry::resolveHandle() , 以及 eve::Result< T >::success().
◆ create() [2/3]
|
static |
Create from a Vehicle module's canonical definition registry.
在文件 VehicleDefinitionRuntime.cpp 第 381 行定义.
引用了 create(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::DefinitionRef::fromId(), eve::LogicalId::fromParts(), eve::InvalidArgument , 以及 reference.
◆ create() [3/3]
|
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 |
Resolve and parse the current strongly typed VehicleDefinition.
在文件 VehicleDefinitionRuntime.cpp 第 413 行定义.
引用了 definitionHandle(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::vehicle::parseVehicleDefinition() , 以及 eve::definitions::DefinitionRegistry::resolveHandle().
◆ definitionHandle()
|
noexcept |
Return the generation-qualified definition handle.
在文件 VehicleDefinitionRuntime.cpp 第 409 行定义.
被这些函数引用 definition() , 以及 restore().
◆ identity()
|
noexcept |
Borrow common instance identity and exact definition generation.
在文件 VehicleDefinitionRuntime.cpp 第 401 行定义.
◆ isActive()
|
noexcept |
◆ operator=() [1/2]
|
delete |
◆ operator=() [2/2]
|
defaultnoexcept |
Operator =.
◆ reload()
| eve::Result< eve::definition::ReloadOutcome > eve::vehicle::VehicleDefinitionRuntime::reload | ( | eve::definition::ReloadPolicy | policy | ) |
Reload the registry's current generation using a typed policy.
在文件 VehicleDefinitionRuntime.cpp 第 474 行定义.
引用了 definition(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::vehicle::VehicleRuntimeState::health, identity(), eve::InvalidArgument, eve::vehicle::parseVehicleDefinition(), eve::definitions::DefinitionRegistry::resolveHandle() , 以及 eve::Result< T >::success().
◆ reloadPolicy()
|
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()
|
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]
|
noexcept |
◆ state() [2/2]
|
noexcept |
Mutate vehicle state on the owner thread.
在文件 VehicleDefinitionRuntime.cpp 第 407 行定义.
该类的文档由以下文件生成:
- src/modules/vehicle/VehicleDefinitionRuntime.h
- src/modules/vehicle/VehicleDefinitionRuntime.cpp