amount Folder
Files Index
| file | helios/engine/runtime/spawn/policy/amount/_module.ixx |
|
Aggregate module for helios::engine::runtime::spawn::policy::amount namespace. More... | |
| file | FixedSpawnAmount.ixx |
|
Amount provider that returns a fixed spawn count. More... | |
| file | SpawnAll.ixx |
|
Spawn amount provider that spawns all available pool objects. More... | |
| file | SpawnAmountByCallback.ixx |
|
Amount provider that delegates to a user-provided callback. More... | |
| file | SpawnAmountProvider.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
| Class | Purpose |
|---|---|
| SpawnAmountProvider | Abstract interface for calculating spawn quantity |
| FixedSpawnAmount | Always returns a fixed count |
| SpawnAmountByCallback | Delegates 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.