GameObjectPoolConfig Struct
Configuration structure for creating a GameObjectPool. More...
Declaration
Public Member Attributes Index
| const helios::engine::runtime::pooling::types::GameObjectPoolId | gameObjectPoolId |
|
Unique identifier for the pool. More... | |
| const helios::engine::common::types::PrefabId | prefabId |
|
Identifier of the prefab template used for cloning. More... | |
| const size_t | amount |
|
Initial number of objects to pre-allocate in the pool. More... | |
Description
Configuration structure for creating a GameObjectPool.
GameObjectPoolConfig bundles all information required to initialize a GameObjectPool: a unique pool identifier, a PrefabId referencing the prefab template, and the initial pool size.
The PrefabId identifies the prefab GameObject that serves as the archetype from which all pooled instances are cloned. The prefab is registered separately via GameObjectFactory::withPrefabId() and looked up by the pool system at initialization time.
Example usage: ```cpp // Create and tag prefab auto enemyPrefab = GameObjectFactory::instance() .gameObject(gameWorld) .withPrefabId(EnemyPrefabId) // ... component configuration ... .make();
auto config = std::make_unique<GameObjectPoolConfig>( EnemyPoolId, EnemyPrefabId, 50 // Pre-allocate 50 clones );
poolManager.addPoolConfig(std::move(config)); ```
- See Also
PrefabId
- See Also
PrefabIdComponent
- See Also
- See Also
GameObjectPoolId
- See Also
Definition at line 53 of file GameObjectPoolConfig.ixx.
Public Member Attributes
amount
|
Initial number of objects to pre-allocate in the pool.
Determines how many clones of the prefab are created upfront. Higher values reduce runtime allocations but increase memory usage.
Definition at line 77 of file GameObjectPoolConfig.ixx.
gameObjectPoolId
|
Unique identifier for the pool.
Used to reference and retrieve the pool from registries.
Definition at line 60 of file GameObjectPoolConfig.ixx.
prefabId
|
Identifier of the prefab template used for cloning.
References the prefab GameObject tagged with the matching PrefabIdComponent. The pool system resolves this ID to the actual entity at initialization time.
Definition at line 69 of file GameObjectPoolConfig.ixx.
The documentation for this struct was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.