Skip to main content

bootstrap Namespace

Definition

namespace helios::engine::bootstrap { ... }

Functions Index

voidregisterAllComponents ()

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()

std::pair< std::unique_ptr< GameWorld >, std::unique_ptr< GameLoop > > helios::engine::bootstrap::makeGameWorld (const size_t capacity=ENTITY_MANAGER_DEFAULT_CAPACITY)
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:

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.

Returns

A pair of (GameWorld, GameLoop) unique pointers.

See Also

registerAllComponents

See Also

GameWorld

See Also

GameLoop

See Also

EngineCommandBuffer

See Also

Session::trackState

Definition at line 115 of file bootstrap.ixx.

115 inline std::pair<std::unique_ptr<GameWorld>, std::unique_ptr<GameLoop>> makeGameWorld(
116 const size_t capacity = ENTITY_MANAGER_DEFAULT_CAPACITY
117 ) {
118 auto gameLoop = std::make_unique<helios::engine::runtime::gameloop::GameLoop>();
119 auto gameWorld = std::make_unique<helios::engine::runtime::world::GameWorld>(capacity);
120
126 gameWorld->registerManager<helios::engine::mechanics::timing::TimerManager>();
127
128 gameWorld->session().trackState<helios::engine::mechanics::gamestate::types::GameState>();
129 gameWorld->session().trackState<helios::engine::mechanics::match::types::MatchState>();
130
132
133 return std::make_pair(std::move(gameWorld), std::move(gameLoop));
134 }

References helios::engine::mechanics::gamestate::rules::DefaultGameStateTransitionRules::rules and helios::engine::mechanics::match::rules::DefaultMatchStateTransitionRules::rules.

registerAllComponents()

void helios::engine::bootstrap::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(); ```

info

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.

56 inline void registerAllComponents() {
57
58 static bool done = false;
59 if (done) return;
60 done = true;
61
65
66 }

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.