Skip to main content

amount Folder

Files Index

filehelios/engine/runtime/spawn/policy/amount/_module.ixx

Aggregate module for helios::engine::runtime::spawn::policy::amount namespace. More...

fileFixedSpawnAmount.ixx

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

fileSpawnAll.ixx

Spawn amount provider that spawns all available pool objects. More...

fileSpawnAmountByCallback.ixx

Amount provider that delegates to a user-provided callback. More...

fileSpawnAmountProvider.ixx

Abstract interface for determining spawn quantity. More...

Description

helios::engine::runtime::spawn::policy::amount

Spawn amount providers for determining spawn quantities.

Overview

This module provides SpawnAmountProvider implementations that determine how many entities should spawn when a rule's condition is satisfied.

Key Classes

ClassPurpose
SpawnAmountProviderAbstract interface for calculating spawn quantity
FixedSpawnAmountAlways returns a fixed count
SpawnAmountByCallbackDelegates to a user-provided callback function

Usage

 // Fixed amount: always spawn 3 entities
 auto amount = std::make_unique<FixedSpawnAmount>(3);
 
 // Callback-based: dynamic amount based on game state
 auto dynamicAmount = std::make_unique<SpawnAmountByCallback>(
  [&DIFFICULTY_LEVEL](const GameObjectPoolId& poolId, const SpawnRuleState& state,
  const UpdateContext& ctx) -> size_t {
  // Spawn more enemies as difficulty increases
  return DIFFICULTY_LEVEL + 1;
  }
 );
 
 // Use with SpawnRule
 auto rule = std::make_unique<SpawnRule>(
  std::make_unique<TimerSpawnCondition>(2.0f),
  std::move(amount),
  SpawnRuleId{1}
 );


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.