Skip to main content

SpawnContext Struct

Context data passed to spawn behaviors during entity initialization. More...

Declaration

struct helios::engine::runtime::spawn::SpawnContext { ... }

Public Member Attributes Index

std::optional< EmitterContext >emitterContext

Optional context from the entity that triggered the spawn. More...

Description

Context data passed to spawn behaviors during entity initialization.

SpawnContext aggregates all contextual information needed by SpawnPlacer and SpawnInitializer to configure a spawned entity. It may contain an EmitterContext if the spawn was triggered by another entity.

Example usage: ```cpp SpawnContext ctx; ctx.emitterContext = EmitterContext{shipPos, shipVelocity};

placer->getPosition(guid, bounds, cursor, ctx); initializer->initialize(entity, cursor, ctx); ```

See Also

EmitterContext

See Also

SpawnPlacer

See Also

SpawnInitializer

Definition at line 35 of file SpawnContext.ixx.

Public Member Attributes

emitterContext

std::optional<EmitterContext> helios::engine::runtime::spawn::SpawnContext::emitterContext

Optional context from the entity that triggered the spawn.

Present when an entity (e.g., spaceship) triggered the spawn. Absent for environment spawns or timer-based spawns.

Definition at line 43 of file SpawnContext.ixx.

43 std::optional<EmitterContext> emitterContext;

Referenced by helios::engine::runtime::spawn::behavior::placements::EmitterSpawnPlacer::getPosition and helios::engine::runtime::spawn::behavior::initializers::EmitterInitializer::initialize.


The documentation for this struct was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.