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

Owner-thread deterministic carrier simulator with composable behaviors. 更多...

#include <CombatCarrier.h>

Public 成员函数

 CombatCarrierRuntime ()
 Combat carrier runtime.
 
Result< void > configurePool (std::uint32_t capacity)
 Resize the pool while empty; capacity must be in 1..1048576.
 
Result< void > configureSimulation (const CarrierSimulationSettings &settings)
 Copy validated solver settings while the pool is empty; conflicts fail atomically. @ownership Caller retains settings; no references are retained.
 
Result< void > registerRecipe (const CarrierRecipe &recipe)
 Register a recipe, or replace it only when no live carrier uses the id. Equal registration is a no-op; conflicting live replacement fails atomically. @ownership Runtime copies the recipe; callers may discard their instance.
 
std::optional< CarrierRecipe > findRecipe (const LogicalId &id) const
 Look up a previously registered recipe by id.
 
Result< CarrierHandle > spawn (const LogicalId &recipeId, const CarrierSpawnRequest &request)
 Spawn one carrier from a registered recipe id.
 
Result< CarrierHandle > spawn (const CarrierRecipe &recipe, const CarrierSpawnRequest &request)
 Spawn one carrier from an inline validated recipe (also registers it).
 
Result< std::vector< CarrierHandle > > spawnVolley (const LogicalId &recipeId, const CarrierSpawnRequest &request, const CarrierVolleySpec &volley)
 Spawn multiple carriers in deterministic Fan/Ring directions.
 
Result< std::vector< CarrierHandle > > spawnVolley (const CarrierRecipe &recipe, const CarrierSpawnRequest &request, const CarrierVolleySpec &volley)
 Spawn volley.
 
Result< CarrierFrame > update (Duration delta, const IProjectileTargetProvider *targets=nullptr, const ICarrierHitProbe *hits=nullptr, const ICarrierBodyDefenseProvider *bodies=nullptr, const ICarrierHitProbe *worldSweep=nullptr)
 Atomically advance all live carriers by supplied deterministic time.
 
Result< CarrierFrame > updateWithMotion (Duration delta, const ICarrierMotionFunction &motion, const IProjectileTargetProvider *targets=nullptr, const ICarrierHitProbe *hits=nullptr, const ICarrierBodyDefenseProvider *bodies=nullptr, const ICarrierHitProbe *worldSweep=nullptr)
 Advance using a caller-owned custom motion function, before hits and triggers. @ownership All providers are borrowed synchronously and never retained.
 
Result< void > release (CarrierHandle handle)
 Explicitly release one live handle; stale handles are rejected.
 
std::optional< CarrierState > find (CarrierHandle handle) const
 Return an owning state copy, or empty for a stale/released handle.
 
std::vector< CarrierState > states () const
 Return owning live states in stable slot order.
 
CarrierRuntimeSnapshot snapshot () const
 Capture live carriers plus empty-slot generations.
 
Result< void > restore (const CarrierRuntimeSnapshot &snapshot)
 Atomically replace this pool from a validated snapshot.
 
std::size_t activeCount () const noexcept
 Number of live carriers.
 
std::size_t capacity () const noexcept
 Current fixed pool capacity.
 

详细描述

Owner-thread deterministic carrier simulator with composable behaviors.

update stages every live carrier on a candidate copy and publishes only after all target/hit lookups succeed. Providers are borrowed only for the synchronous call, must not mutate this runtime reentrantly, and may be destroyed after it returns. Same-backend replay requires identical dt/provider inputs and recipe context; cross-backend floating-point comparisons use 1e-6 simulation units. Child spawns are attempted at frame end; pool exhaustion fails the whole frame without partial publish.

在文件 CombatCarrier.h 第 410 行定义.

构造及析构函数说明

◆ CombatCarrierRuntime()

eve::weapon::CombatCarrierRuntime::CombatCarrierRuntime ( )

Combat carrier runtime.

在文件 CombatCarrier.cpp 第 375 行定义.

成员函数说明

◆ activeCount()

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

Number of live carriers.

在文件 CombatCarrier.h 第 499 行定义.

◆ capacity()

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

Current fixed pool capacity.

在文件 CombatCarrier.h 第 502 行定义.

被这些函数引用 configurePool().

◆ configurePool()

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

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

在文件 CombatCarrier.cpp 第 396 行定义.

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

◆ configureSimulation()

Result< void > eve::weapon::CombatCarrierRuntime::configureSimulation ( const CarrierSimulationSettings &  settings)

Copy validated solver settings while the pool is empty; conflicts fail atomically. @ownership Caller retains settings; no references are retained.

备注
Owner thread only; reentrant mutation is rejected. Snapshots include these settings.

在文件 CombatCarrier.cpp 第 386 行定义.

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

◆ find()

std::optional< CarrierState > eve::weapon::CombatCarrierRuntime::find ( CarrierHandle  handle) const

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

在文件 CombatCarrier.cpp 第 1377 行定义.

引用了 cell , 以及 handle.

◆ findRecipe()

std::optional< CarrierRecipe > eve::weapon::CombatCarrierRuntime::findRecipe ( const LogicalId &  id) const

Look up a previously registered recipe by id.

在文件 CombatCarrier.cpp 第 455 行定义.

引用了 live.

◆ registerRecipe()

Result< void > eve::weapon::CombatCarrierRuntime::registerRecipe ( const CarrierRecipe &  recipe)

Register a recipe, or replace it only when no live carrier uses the id. Equal registration is a no-op; conflicting live replacement fails atomically. @ownership Runtime copies the recipe; callers may discard their instance.

在文件 CombatCarrier.cpp 第 433 行定义.

引用了 eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), live, eve::NoOp, recipe, slot, eve::Status::success() , 以及 eve::Result< T >::success().

被这些函数引用 spawn() , 以及 spawnVolley().

◆ release()

Result< void > eve::weapon::CombatCarrierRuntime::release ( CarrierHandle  handle)

Explicitly release one live handle; stale handles are rejected.

在文件 CombatCarrier.cpp 第 1363 行定义.

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

◆ restore()

Result< void > eve::weapon::CombatCarrierRuntime::restore ( const CarrierRuntimeSnapshot &  snapshot)

◆ snapshot()

CarrierRuntimeSnapshot eve::weapon::CombatCarrierRuntime::snapshot ( ) const

◆ spawn() [1/2]

Result< CarrierHandle > eve::weapon::CombatCarrierRuntime::spawn ( const CarrierRecipe &  recipe,
const CarrierSpawnRequest &  request 
)

Spawn one carrier from an inline validated recipe (also registers it).

在文件 CombatCarrier.cpp 第 528 行定义.

引用了 eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), recipe, registerRecipe(), request, spawn() , 以及 valid.

◆ spawn() [2/2]

Result< CarrierHandle > eve::weapon::CombatCarrierRuntime::spawn ( const LogicalId &  recipeId,
const CarrierSpawnRequest &  request 
)

Spawn one carrier from a registered recipe id.

在文件 CombatCarrier.cpp 第 517 行定义.

引用了 eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), live, eve::NotFound , 以及 request.

被这些函数引用 spawn() , 以及 spawnVolley().

◆ spawnVolley() [1/2]

Result< std::vector< CarrierHandle > > eve::weapon::CombatCarrierRuntime::spawnVolley ( const CarrierRecipe &  recipe,
const CarrierSpawnRequest &  request,
const CarrierVolleySpec &  volley 
)

◆ spawnVolley() [2/2]

Result< std::vector< CarrierHandle > > eve::weapon::CombatCarrierRuntime::spawnVolley ( const LogicalId &  recipeId,
const CarrierSpawnRequest &  request,
const CarrierVolleySpec &  volley 
)

Spawn multiple carriers in deterministic Fan/Ring directions.

Each projectile shares the base position/target/source and receives a rotated aim vector. Fails without partial spawns when the pool cannot fit the full volley or any single spawn is invalid.

在文件 CombatCarrier.cpp 第 542 行定义.

引用了 eve::Conflict, direction, eve::weapon::CarrierSpawnRequest::direction, eve::Diagnostic::error(), request, spawn(), spawned , 以及 volley.

被这些函数引用 spawnVolley().

◆ states()

std::vector< CarrierState > eve::weapon::CombatCarrierRuntime::states ( ) const

Return owning live states in stable slot order.

在文件 CombatCarrier.cpp 第 1384 行定义.

引用了 result , 以及 slot.

◆ update()

Result< CarrierFrame > eve::weapon::CombatCarrierRuntime::update ( Duration  delta,
const IProjectileTargetProvider *  targets = nullptr,
const ICarrierHitProbe *  hits = nullptr,
const ICarrierBodyDefenseProvider *  bodies = nullptr,
const ICarrierHitProbe *  worldSweep = nullptr 
)

Atomically advance all live carriers by supplied deterministic time.

参数
targetsOptional provider required when any live recipe uses homing/proximity.
hitsOrdinary collision probe for enabled OnHit recipes without physicsWorldSweep.
worldSweepOptional physics-world adapter for enabled OnHit recipes selecting physicsWorldSweep. @ownership Probes are borrowed for this call only, on the owner thread, without locks. The world adapter owns shape/filter/body-to-entity mapping; no physics dependency is required otherwise.
bodiesOptional provider required when any live recipe uses SteerAvoidBody.

在文件 CombatCarrier.cpp 第 590 行定义.

引用了 targets.

◆ updateWithMotion()

Result< CarrierFrame > eve::weapon::CombatCarrierRuntime::updateWithMotion ( Duration  delta,
const ICarrierMotionFunction &  motion,
const IProjectileTargetProvider *  targets = nullptr,
const ICarrierHitProbe *  hits = nullptr,
const ICarrierBodyDefenseProvider *  bodies = nullptr,
const ICarrierHitProbe *  worldSweep = nullptr 
)

Advance using a caller-owned custom motion function, before hits and triggers. @ownership All providers are borrowed synchronously and never retained.

备注
Owner thread only. Reentrant mutation fails; callback failures abort publication. Custom distance is the swept chord length. Return proposed to retain built-in curve bookkeeping. @cost One user function call per live carrier per step, amortized by fixed simulation ticks.

在文件 CombatCarrier.cpp 第 597 行定义.

引用了 targets.


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