载入中...
搜索中...
未找到
eve::weapon::ProjectileRuntime类 参考

Owner-thread deterministic projectile simulator with a bounded reusable pool. 更多...

#include <ProjectileRuntime.h>

Public 成员函数

 ProjectileRuntime ()
 Projectile runtime.
 
Result< void > configurePool (std::uint32_t capacity)
 Resize the pool while empty; capacity must be in 1..1048576.
 
Result< ProjectileHandle > spawn (const ProjectileDefinition &definition, const ProjectileSpawnRequest &request)
 Spawn one projectile or return a structured capacity/validation failure.
 
Result< ProjectileUpdate > update (Duration delta, const IProjectileTargetProvider *targets=nullptr)
 Atomically advance all live projectiles by supplied deterministic time.
 
Result< void > release (ProjectileHandle handle)
 Explicitly release one live handle; stale handles are rejected.
 
std::optional< ProjectileState > find (ProjectileHandle handle) const
 Return an owning state copy, or empty for a stale/released handle.
 
std::vector< ProjectileState > states () const
 Return owning live states in stable slot order.
 
ProjectileRuntimeSnapshot snapshot () const
 Capture live trajectories plus empty-slot generations.
 
Result< void > restore (const ProjectileRuntimeSnapshot &snapshot)
 Atomically replace this pool from a validated snapshot.
 
std::size_t activeCount () const noexcept
 Number of live projectiles.
 
std::size_t capacity () const noexcept
 Current fixed pool capacity.
 

详细描述

Owner-thread deterministic projectile simulator with a bounded reusable pool.

update stages every live state and publishes only after all homing target lookups succeed. It uses injected Duration and no clock or RNG. Floating point replay is deterministic for the same compiler/backend; cross-backend comparison should use a documented positional tolerance.

在文件 ProjectileRuntime.h 第 118 行定义.

构造及析构函数说明

◆ ProjectileRuntime()

eve::weapon::ProjectileRuntime::ProjectileRuntime ( )

Projectile runtime.

在文件 ProjectileRuntime.cpp 第 70 行定义.

成员函数说明

◆ activeCount()

std::size_t eve::weapon::ProjectileRuntime::activeCount ( ) const
inlinenoexcept

Number of live projectiles.

在文件 ProjectileRuntime.h 第 141 行定义.

◆ capacity()

std::size_t eve::weapon::ProjectileRuntime::capacity ( ) const
inlinenoexcept

Current fixed pool capacity.

在文件 ProjectileRuntime.h 第 143 行定义.

被这些函数引用 configurePool().

◆ configurePool()

Result< void > eve::weapon::ProjectileRuntime::configurePool ( std::uint32_t  capacity)

Resize the pool while empty; capacity must be in 1..1048576.

在文件 ProjectileRuntime.cpp 第 72 行定义.

引用了 capacity(), eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 eve::Result< T >::success().

◆ find()

std::optional< ProjectileState > eve::weapon::ProjectileRuntime::find ( ProjectileHandle  handle) const

Return an owning state copy, or empty for a stale/released handle.

在文件 ProjectileRuntime.cpp 第 173 行定义.

引用了 handle.

◆ release()

Result< void > eve::weapon::ProjectileRuntime::release ( ProjectileHandle  handle)

Explicitly release one live handle; stale handles are rejected.

在文件 ProjectileRuntime.cpp 第 164 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), handle, eve::StaleHandle , 以及 eve::Result< T >::success().

◆ restore()

Result< void > eve::weapon::ProjectileRuntime::restore ( const ProjectileRuntimeSnapshot &  snapshot)

◆ snapshot()

ProjectileRuntimeSnapshot eve::weapon::ProjectileRuntime::snapshot ( ) const

Capture live trajectories plus empty-slot generations.

在文件 ProjectileRuntime.cpp 第 188 行定义.

引用了 eve::weapon::ProjectileRuntimeSnapshot::slots.

◆ spawn()

Result< ProjectileHandle > eve::weapon::ProjectileRuntime::spawn ( const ProjectileDefinition &  definition,
const ProjectileSpawnRequest &  request 
)

Spawn one projectile or return a structured capacity/validation failure.

在文件 ProjectileRuntime.cpp 第 94 行定义.

引用了 eve::Conflict, direction, eve::Diagnostic::error(), eve::Result< T >::failure(), index, request, state, eve::Result< T >::success() , 以及 valid.

◆ states()

std::vector< ProjectileState > eve::weapon::ProjectileRuntime::states ( ) const

Return owning live states in stable slot order.

在文件 ProjectileRuntime.cpp 第 180 行定义.

被这些函数引用 eve::rts::RTSProjectileSystem::restore().

◆ update()


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