GameObjectSpawnSystem Class
Declaration
class helios::engine::mechanics::spawn::systems::GameObjectSpawnSystem { ... }
Public Member Typedefs Index
Public Constructors Index
Public Member Functions Index
| void | init (GameWorld &gameWorld) noexcept |
|
|
|
| void | update (helios::engine::runtime::world::UpdateContext &updateContext) noexcept |
|
Processes spawn scheduling and enqueues spawn commands. More...
|
|
Private Member Attributes Index
Definition at line 31 of file GameObjectSpawnSystem.ixx.
Public Member Typedefs
EngineRoleTag
| using helios::engine::mechanics::spawn::systems::GameObjectSpawnSystem::EngineRoleTag = helios::engine::common::tags::SystemRole |
|
Public Constructors
GameObjectSpawnSystem()
Public Member Functions
init()
| void helios::engine::mechanics::spawn::systems::GameObjectSpawnSystem::init (GameWorld & gameWorld) |
|
inline
noexcept
|
update()
Processes spawn scheduling and enqueues spawn commands.
Iterates through all schedulers and performs these steps for each: 1. Reads `SpawnPlanCommandExecutedEvent` from frame event bus 2. Commits completed spawns to the scheduler (for tracking/cooldowns) 3. Evaluates all spawn rules against current conditions 4. Drains ready spawn plans and enqueues them as commands
- Parameters
-
| updateContext | The current frame's update context. |
Definition at line 62 of file GameObjectSpawnSystem.ixx.
63
64 const auto& events = updateContext.readFrame<
66 >();
67
68 for (const auto& spawnScheduler : spawnManager_.spawnSchedulers()) {
69
70
71
72
73
74
75 for (const auto& event : events) {
76 spawnScheduler->commit(event.spawnRuleId, event.spawnCount);
77 }
78
79 spawnScheduler->evaluate(*gameWorld_, updateContext);
80
81 auto scheduledPlans = spawnScheduler->drainScheduledPlans();
82
83 for (auto& plan : scheduledPlans) {
84 updateContext.queueCommand<
86 >(
87 plan.spawnProfileId, plan.spawnPlan, plan.spawnContext
88 );
89 }
90 }
91
92 }
Private Member Attributes
gameWorld_
| GameWorld* helios::engine::mechanics::spawn::systems::GameObjectSpawnSystem::gameWorld_ = nullptr |
|
spawnManager_
| helios::engine::runtime::spawn::SpawnManager& helios::engine::mechanics::spawn::systems::GameObjectSpawnSystem::spawnManager_ |
|
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.