Skip to main content

FixedSpawnAmount Class

Amount provider that returns a fixed spawn count. More...

Declaration

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

Base class

classSpawnAmountProvider

Abstract interface for determining spawn quantity. More...

Public Constructors Index

FixedSpawnAmount (const size_t amount)

Constructs a FixedSpawnAmount with the specified count. 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...

Private Member Attributes Index

size_tamount_

The fixed number of entities to spawn. More...

Description

Amount provider that returns a fixed spawn count.

FixedSpawnAmount always returns the same number of entities to spawn, regardless of game state. Useful for simple, predictable spawn patterns.

See Also

SpawnAmountProvider

Definition at line 26 of file FixedSpawnAmount.ixx.

Public Constructors

FixedSpawnAmount()

helios::engine::runtime::spawn::policy::amount::FixedSpawnAmount::FixedSpawnAmount (const size_t amount)
inline explicit

Constructs a FixedSpawnAmount with the specified count.

Parameters
amount

The number of entities to spawn each time.

Definition at line 40 of file FixedSpawnAmount.ixx.

40 explicit FixedSpawnAmount(const size_t amount)
41 : amount_(amount) {}

Public Member Functions

getAmount()

size_t helios::engine::runtime::spawn::policy::amount::FixedSpawnAmount::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 46 of file FixedSpawnAmount.ixx.

46 [[nodiscard]] size_t getAmount(
48 const SpawnRuleState& spawnRuleState,
51 ) const override {
52 return amount_;
53 }

Private Member Attributes

amount_

size_t helios::engine::runtime::spawn::policy::amount::FixedSpawnAmount::amount_

The fixed number of entities to spawn.

Definition at line 31 of file FixedSpawnAmount.ixx.

31 size_t amount_;

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.