spawnSystem Folder
Folders Index
| folder | builders |
Files Index
| file | helios/engine/builder/spawnSystem/_module.ixx |
|
Module aggregation for helios.engine.builder.spawnSystem. More... | |
| file | SpawnSystemFactory.ixx |
|
Factory for fluent, ID-centric configuration of the spawn system. More... | |
Description
helios.engine.builder.spawnSystem
Fluent, ID-centric builder API for configuring the spawn system: pools, profiles, and schedulers.
Overview
SpawnSystemFactory provides an API where each pool ID is the entry point for all related configuration. Profiles and scheduling rules are nested under their pool, ensuring co-location of related IDs and reducing configuration errors.
Architecture
Usage
ID-centric API (recommended)
Chained Pool Configuration
commit() and commitCyclic<N>() return a SpawnSystemConfigurator that provides pool() for starting the next pool configuration:
Separate Scheduling with commitProfilesOnly()
When the same profiles need different scheduling strategies (e.g., in different levels), commit profiles without rules and attach schedulers separately:
Design Decisions
- ID-centric: Pool ID is the root of all related config - no mismatched IDs possible
- No GameLoop dependency: Dispatcher registration is the caller's responsibility
- commit() vs commitCyclic<N>(): commit() creates per-profile DefaultSpawnSchedulers; commitCyclic<N>() bundles all rules into a single CyclicSpawnScheduler
- commitProfilesOnly(): Registers pool and profiles without schedulers, enabling separate scheduling via SchedulerBuilder
- done() chaining: Nested configs return to their parent via done(), enabling natural indentation
- Move-only configs: SpawnPoolConfig is not copyable (unique_ptr members). For reusable profile setups with different scheduling, use commitProfilesOnly() + SchedulerBuilder
See Also
- GameObjectFactory - analogous builder for GameObjects
- SpawnManager - processes spawn/despawn commands
- GameObjectPoolManager - manages pre-allocated pools
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.