Skip to main content

SpawnAll Class

Spawns all inactive objects from a pool. More...

Declaration

class helios::engine::runtime::spawn::policy::amount::SpawnAll { ... }

Base class

classSpawnAmountProvider

Abstract interface for determining spawn quantity. More...

Public Member Functions Index

size_tgetAmount (const helios::engine::runtime::pooling::types::GameObjectPoolId gameObjectPoolId, const SpawnRuleState &spawnRuleState, const helios::engine::runtime::world::GameWorld &gameWorld, const helios::engine::runtime::world::UpdateContext &updateContext) const override

Returns the number of entities to spawn. More...

Description

Spawns all inactive objects from a pool.

This provider queries the GameObjectPoolManager to determine how many inactive objects are available in the specified pool and returns that count as the spawn amount.

Useful for scenarios where all pooled objects should be spawned at once, such as initial wave spawning or respawning all enemies after a level reset.

Definition at line 32 of file SpawnAll.ixx.

Public Member Functions

getAmount()

size_t helios::engine::runtime::spawn::policy::amount::SpawnAll::getAmount (const helios::engine::runtime::pooling::types::GameObjectPoolId gameObjectPoolId, const SpawnRuleState & spawnRuleState, const helios::engine::runtime::world::GameWorld & gameWorld, const helios::engine::runtime::world::UpdateContext & updateContext)
inline nodiscard virtual

Returns the number of entities to spawn.

Parameters
gameObjectPoolId

The pool to spawn from.

spawnRuleState

The rule's current runtime state.

gameWorld

The game world in which the spawn occurs.

updateContext

The current frame's context.

Returns

Number of entities to spawn.

Definition at line 39 of file SpawnAll.ixx.

39 [[nodiscard]] size_t getAmount(
41 const SpawnRuleState& spawnRuleState,
44 ) const override {
46 if (!manager) {
47 return 0;
48 }
49 return manager->poolSnapshot(gameObjectPoolId).inactiveCount;
50 }

References helios::engine::runtime::pooling::GameObjectPoolSnapshot::inactiveCount, helios::engine::runtime::pooling::GameObjectPoolManager::poolSnapshot and helios::engine::runtime::world::GameWorld::tryManager.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.