bootstrap Namespace
Definition
Functions Index
| void | registerAllComponents () |
|
Registers all component types with the ComponentReflector. More... | |
| std::pair< std::unique_ptr< GameWorld >, std::unique_ptr< GameLoop > > | makeGameWorld (const size_t capacity=ENTITY_MANAGER_DEFAULT_CAPACITY) |
|
Creates a pre-configured GameWorld and GameLoop pair. More... | |
Functions
makeGameWorld()
| inline |
Creates a pre-configured GameWorld and GameLoop pair.
The factory heap-allocates both objects and performs the minimal setup required before application-specific configuration:
- Registers the `EngineCommandBuffer` with the GameWorld's ResourceRegistry.
- Tracks `GameState` and `MatchState` in the Session so that TypedPass state filtering works out of the box.
The caller receives ownership via `unique_ptr` and is responsible for registering Managers, configuring phases/passes, calling `GameWorld::init()` and `GameLoop::init()`, and driving the main loop.
## Usage
```cpp helios::engine::bootstrap::registerAllComponents();
auto [gameWorldPtr, gameLoopPtr] = helios::engine::bootstrap::makeGameWorld(); auto& gameWorld = *gameWorldPtr; auto& gameLoop = *gameLoopPtr;
// Application-specific setup gameWorld.registerResource<SpawnManager>(); gameLoop.phase(PhaseType::Pre) .addPass<GameState>(GameState::Any) .addSystem<InputSystem>();
gameWorld.init(); gameLoop.init(gameWorld); ```
- Parameters
-
capacity Initial capacity for the EntityManager's SparseSets. Must be large enough to accommodate all entities including pooled clones. Defaults to ENTITY_MANAGER_DEFAULT_CAPACITY.
- See Also
- See Also
- See Also
- See Also
EngineCommandBuffer
- See Also
Definition at line 115 of file bootstrap.ixx.
References helios::engine::mechanics::gamestate::rules::DefaultGameStateTransitionRules::rules and helios::engine::mechanics::match::rules::DefaultMatchStateTransitionRules::rules.
registerAllComponents()
| inline |
Registers all component types with the ComponentReflector.
This function must be called during engine initialization to enable runtime reflection features such as cloning, lifecycle callbacks (onAcquire, onRelease, onRemove), and enable/disable toggles.
## Usage
```cpp // Call once during engine startup helios::engine::bootstrap::registerAllComponents(); ```
New component types must be added to the respective module's registry.ixx file to participate in the reflection system.
- See Also
ComponentReflector
- See Also
ComponentOpsRegistry
Definition at line 56 of file bootstrap.ixx.
References helios::engine::ecs::registerComponents, helios::engine::mechanics::registerComponents and helios::engine::modules::registerComponents.
The documentation for this namespace was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.