Skip to main content

SpawnContext.ixx File

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

Included Headers

#include <optional> #include <helios.engine.runtime.spawn.EmitterContext>

Namespaces Index

namespacehelios
namespaceengine

Main engine module aggregating core infrastructure and game systems. More...

namespaceruntime

Runtime infrastructure for game execution and lifecycle orchestration. More...

namespacespawn

Entity spawning infrastructure for the helios engine. More...

Classes Index

structSpawnContext

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

Description

Context data passed to spawn behaviors during entity initialization.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file SpawnContext.ixx
3 * @brief Context data passed to spawn behaviors during entity initialization.
4 */
5module;
6
7#include <optional>
8
9export module helios.engine.runtime.spawn.SpawnContext;
10
11import helios.engine.runtime.spawn.EmitterContext;
12
13export namespace helios::engine::runtime::spawn {
14
15 /**
16 * @brief Context data passed to spawn behaviors during entity initialization.
17 *
18 * @details SpawnContext aggregates all contextual information needed by
19 * SpawnPlacer and SpawnInitializer to configure a spawned entity. It may
20 * contain an EmitterContext if the spawn was triggered by another entity.
21 *
22 * Example usage:
23 * ```cpp
24 * SpawnContext ctx;
25 * ctx.emitterContext = EmitterContext{shipPos, shipVelocity};
26 *
27 * placer->getPosition(guid, bounds, cursor, ctx);
28 * initializer->initialize(entity, cursor, ctx);
29 * ```
30 *
31 * @see EmitterContext
32 * @see SpawnPlacer
33 * @see SpawnInitializer
34 */
35 struct SpawnContext {
36
37 /**
38 * @brief Optional context from the entity that triggered the spawn.
39 *
40 * Present when an entity (e.g., spaceship) triggered the spawn.
41 * Absent for environment spawns or timer-based spawns.
42 */
43 std::optional<EmitterContext> emitterContext;
44
45 };
46
47
48}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.