Skip to main content

EntityPoolConfig Struct

Configuration structure for creating a EntityPool. More...

Declaration

struct helios::engine::runtime::pooling::EntityPoolConfig { ... }

Public Member Attributes Index

const helios::engine::runtime::pooling::types::EntityPoolIdentityPoolId

Unique identifier for the pool. More...

const helios::engine::runtime::pooling::types::PrefabIdprefabId

Identifier of the prefab template used for cloning. More...

const size_tamount

Initial number of objects to pre-allocate in the pool. More...

Description

Configuration structure for creating a EntityPool.

EntityPoolConfig bundles all information required to initialize a EntityPool: a unique pool identifier, a PrefabId referencing the prefab template, and the initial pool size.

The PrefabId identifies the prefab Entity that serves as the archetype from which all pooled instances are cloned. The prefab is registered separately via EntityFactory::withPrefabId() and looked up by the pool system at initialization time.

Example usage:

 // Create and tag prefab
 auto enemyPrefab = EntityFactory::instance()
  .entity(gameWorld)
  .withPrefabId(EnemyPrefabId)
  // ... component configuration ...
  .make();
 
 auto config = std::make_unique<EntityPoolConfig>(
  50 // Pre-allocate 50 clones
 );
 
 poolManager.addPoolConfig(std::move(config));
See Also

PrefabId

See Also

PrefabIdComponent

See Also

EntityPool

See Also

EntityPoolId

See Also

EntityPoolManager

Definition at line 53 of file EntityPoolConfig.ixx.

Public Member Attributes

amount

const size_t helios::engine::runtime::pooling::EntityPoolConfig::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 EntityPoolConfig.ixx.

77 const size_t amount;

entityPoolId

const helios::engine::runtime::pooling::types::EntityPoolId helios::engine::runtime::pooling::EntityPoolConfig::entityPoolId

Unique identifier for the pool.

Used to reference and retrieve the pool from registries.

Definition at line 60 of file EntityPoolConfig.ixx.

prefabId

const helios::engine::runtime::pooling::types::PrefabId helios::engine::runtime::pooling::EntityPoolConfig::prefabId

Identifier of the prefab template used for cloning.

References the prefab Entity tagged with the matching PrefabIdComponent. The pool system resolves this ID to the actual entity at initialization time.

Definition at line 69 of file EntityPoolConfig.ixx.


The documentation for this struct was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.