Skip to main content

SpawnPoolConfig Class

ID-centric configuration for a spawn pool with associated profiles. More...

Declaration

class helios::engine::builder::spawnSystem::builders::configs::SpawnPoolConfig { ... }

Public Constructors Index

SpawnPoolConfig (helios::engine::runtime::pooling::GameObjectPoolManager &poolManager, helios::engine::runtime::spawn::SpawnManager &spawnManager, helios::engine::runtime::pooling::types::GameObjectPoolId poolId, helios::engine::common::types::PrefabId prefabId, size_t poolSize)

Constructs a SpawnPoolConfig. More...

Public Member Functions Index

SpawnProfileConfig &profile (helios::engine::runtime::spawn::types::SpawnProfileId profileId)

Begins configuration of a spawn profile for this pool. More...

SpawnSystemConfiguratorcommit ()

Commits pool, all profiles, and registers scheduled rules. More...

SpawnSystemConfiguratorcommitProfilesOnly ()

Commits pool and profiles without creating any schedulers. More...

template <std::size_t N>
SpawnSystemConfiguratorcommitCyclic ()

Commits with all scheduled rules in a single CyclicSpawnScheduler. More...

Private Member Functions Index

voidcommitPool ()

Registers the pool with the pool manager. More...

voidcommitProfiles (bool skipSchedulers)

Commits all profiles and optionally creates per-profile schedulers. More...

Private Member Attributes Index

helios::engine::runtime::pooling::GameObjectPoolManager &poolManager_

The pool manager to register with. More...

helios::engine::runtime::spawn::SpawnManager &spawnManager_

The spawn manager to register profiles with. More...

helios::engine::runtime::pooling::types::GameObjectPoolIdpoolId_

Pool identifier. More...

helios::engine::common::types::PrefabIdprefabId_

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

size_tsize_

Number of instances to pre-allocate. More...

std::vector< std::unique_ptr< SpawnProfileConfig > >profiles_

Profile configurations attached to this pool. More...

Description

ID-centric configuration for a spawn pool with associated profiles.

Bundles a pool ID with its PrefabId, pool size, and one or more spawn profiles. Each profile can optionally have scheduled rules. Calling commit() registers the pool, all profiles, and any scheduled rules with a DefaultSpawnScheduler.

See Also

SpawnProfileConfig

See Also

SpawnRuleConfig

See Also

SpawnSystemFactory

Definition at line 442 of file SpawnPoolConfig.ixx.

Public Constructors

SpawnPoolConfig()

helios::engine::builder::spawnSystem::builders::configs::SpawnPoolConfig::SpawnPoolConfig (helios::engine::runtime::pooling::GameObjectPoolManager & poolManager, helios::engine::runtime::spawn::SpawnManager & spawnManager, helios::engine::runtime::pooling::types::GameObjectPoolId poolId, helios::engine::common::types::PrefabId prefabId, size_t poolSize)
inline

Constructs a SpawnPoolConfig.

Parameters
poolManager

The pool manager to register pools with.

spawnManager

The spawn manager to register profiles with.

poolId

Unique identifier for the pool.

prefabId

Identifier of the prefab template for cloning.

poolSize

Number of instances to pre-allocate.

Definition at line 487 of file SpawnPoolConfig.ixx.

492 size_t poolSize
493 ) : poolManager_(poolManager), spawnManager_(spawnManager),
494 poolId_(poolId), prefabId_(prefabId), size_(poolSize) {}

Public Member Functions

commit()

SpawnSystemConfigurator helios::engine::builder::spawnSystem::builders::configs::SpawnPoolConfig::commit ()
inline

Commits pool, all profiles, and registers scheduled rules.

Profiles with scheduled rules are automatically registered with a DefaultSpawnScheduler per profile.

Returns

Configurator for chaining the next pool() call.

Definition at line 519 of file SpawnPoolConfig.ixx.

520 commitPool();
521 commitProfiles(false);
522 return SpawnSystemConfigurator{poolManager_, spawnManager_};
523 }

commitCyclic()

template <std::size_t N>
SpawnSystemConfigurator helios::engine::builder::spawnSystem::builders::configs::SpawnPoolConfig::commitCyclic ()
inline

Commits with all scheduled rules in a single CyclicSpawnScheduler.

Use this when multiple profiles share a cyclic spawn pattern (e.g., wave-based edge spawning). All rules across all profiles are bundled into one CyclicSpawnScheduler.

Template Parameters
N

Number of rules in the cyclic scheduler.

Returns

Configurator for chaining the next pool() call.

Definition at line 570 of file SpawnPoolConfig.ixx.

571 commitPool();
572
573 auto scheduler = std::make_unique<
575
576 for (auto& profileConfig : profiles_) {
577 auto rules = profileConfig->commit();
578 for (auto& [profileId, rule] : rules) {
579 scheduler->addRule(profileId, std::move(rule));
580 }
581 }
582
583 spawnManager_.addScheduler(std::move(scheduler));
584 return SpawnSystemConfigurator{poolManager_, spawnManager_};
585 }

commitProfilesOnly()

SpawnSystemConfigurator helios::engine::builder::spawnSystem::builders::configs::SpawnPoolConfig::commitProfilesOnly ()
inline

Commits pool and profiles without creating any schedulers.

Use this when profiles should be registered but scheduling is handled separately (e.g., via SchedulerBuilder). Rules attached via scheduledBy() are silently discarded.

This enables reuse of the same profile configuration under different scheduling strategies:

```cpp // Register pool + profiles (no schedulers) spawns.pool(PoolId, PrefabId, 100) .profile(LeftId).axisPlacement(...).moveInitializer(...).done() .profile(RightId).axisPlacement(...).moveInitializer(...).done() .commitProfilesOnly();

// Attach scheduling separately SchedulerBuilder sb(spawnManager); sb.cyclicScheduler( SchedulerConfig(LeftId, Rule1).timerCondition(5.0f).fixedAmount(10), SchedulerConfig(RightId, Rule2).timerCondition(5.0f).fixedAmount(10) ); ```

Returns

Configurator for chaining the next pool() call.

Definition at line 552 of file SpawnPoolConfig.ixx.

553 commitPool();
554 commitProfiles(true);
555 return SpawnSystemConfigurator{poolManager_, spawnManager_};
556 }

profile()

SpawnProfileConfig & helios::engine::builder::spawnSystem::builders::configs::SpawnPoolConfig::profile (helios::engine::runtime::spawn::types::SpawnProfileId profileId)
inline

Begins configuration of a spawn profile for this pool.

Parameters
profileId

Unique identifier for the profile.

Returns

Reference to the new profile config for chaining.

Definition at line 504 of file SpawnPoolConfig.ixx.

505 profiles_.push_back(std::make_unique<SpawnProfileConfig>(
506 *this, spawnManager_, profileId, poolId_
507 ));
508 return *profiles_.back();
509 }

Private Member Functions

commitPool()

void helios::engine::builder::spawnSystem::builders::configs::SpawnPoolConfig::commitPool ()
inline

Registers the pool with the pool manager.

Definition at line 592 of file SpawnPoolConfig.ixx.

592 void commitPool() {
593
594 poolManager_.addPoolConfig(
595 std::make_unique<helios::engine::runtime::pooling::GameObjectPoolConfig>(
596 poolId_, prefabId_, size_
597 )
598 );
599 }

commitProfiles()

void helios::engine::builder::spawnSystem::builders::configs::SpawnPoolConfig::commitProfiles (bool skipSchedulers)
inline

Commits all profiles and optionally creates per-profile schedulers.

Parameters
skipSchedulers

If true, profiles are committed without scheduler creation.

Definition at line 606 of file SpawnPoolConfig.ixx.

606 void commitProfiles(bool skipSchedulers) {
607 for (auto& profileConfig : profiles_) {
608 auto rules = profileConfig->commit();
609 if (!skipSchedulers && !rules.empty()) {
610 auto scheduler = std::make_unique<
612 for (auto& [profileId, rule] : rules) {
613 scheduler->addRule(profileId, std::move(rule));
614 }
615 spawnManager_.addScheduler(std::move(scheduler));
616 }
617 }
618 }

Private Member Attributes

poolId_

helios::engine::runtime::pooling::types::GameObjectPoolId helios::engine::builder::spawnSystem::builders::configs::SpawnPoolConfig::poolId_

Pool identifier.

Definition at line 457 of file SpawnPoolConfig.ixx.

poolManager_

helios::engine::runtime::pooling::GameObjectPoolManager& helios::engine::builder::spawnSystem::builders::configs::SpawnPoolConfig::poolManager_

The pool manager to register with.

Definition at line 447 of file SpawnPoolConfig.ixx.

prefabId_

helios::engine::common::types::PrefabId helios::engine::builder::spawnSystem::builders::configs::SpawnPoolConfig::prefabId_

Identifier of the prefab template for cloning.

Definition at line 462 of file SpawnPoolConfig.ixx.

profiles_

std::vector<std::unique_ptr<SpawnProfileConfig> > helios::engine::builder::spawnSystem::builders::configs::SpawnPoolConfig::profiles_

Profile configurations attached to this pool.

Definition at line 472 of file SpawnPoolConfig.ixx.

472 std::vector<std::unique_ptr<SpawnProfileConfig>> profiles_;

size_

size_t helios::engine::builder::spawnSystem::builders::configs::SpawnPoolConfig::size_

Number of instances to pre-allocate.

Definition at line 467 of file SpawnPoolConfig.ixx.

467 size_t size_;

spawnManager_

helios::engine::runtime::spawn::SpawnManager& helios::engine::builder::spawnSystem::builders::configs::SpawnPoolConfig::spawnManager_

The spawn manager to register profiles with.

Definition at line 452 of file SpawnPoolConfig.ixx.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.