SpawnRule.ixx File
Combines a condition and amount provider into a complete spawn rule. More...
Included Headers
#include <memory>
#include <helios.engine.runtime.spawn.types.SpawnRuleId>
#include <helios.engine.runtime.world>
#include <helios.engine.runtime.pooling.types.GameObjectPoolId>
#include <helios.engine.runtime.pooling.GameObjectPoolSnapshot>
#include <helios.engine.runtime.spawn.scheduling.SpawnPlan>
#include <helios.engine.runtime.spawn.policy.SpawnRuleState>
#include <helios.engine.runtime.spawn.policy.amount.SpawnAmountProvider>
#include <helios.engine.runtime.spawn.policy.SpawnCondition>
Namespaces Index
| namespace | helios |
| namespace | engine |
|
Main engine module aggregating core infrastructure and game systems. More... | |
| namespace | runtime |
|
Runtime infrastructure for game execution and lifecycle orchestration. More... | |
| namespace | spawn |
|
Entity spawning infrastructure for the helios engine. More... | |
| namespace | policy |
|
Spawn rules, conditions, and amount providers. More... | |
Classes Index
| class | SpawnRule |
|
Combines a condition and amount provider into a complete spawn rule. More... | |
Description
Combines a condition and amount provider into a complete spawn rule.
File Listing
The file content with the documentation metadata removed is:
20export namespace helios::engine::runtime::spawn::policy {
62 const helios::engine::runtime::spawn::types::SpawnRuleId spawnRuleId_;
74 std::unique_ptr<const SpawnCondition> spawnCondition,
78 spawnCondition_(std::move(spawnCondition)),
80 spawnRuleId_(spawnRuleId) {}
88 void commit(SpawnRuleState& spawnRuleState, const size_t spawnAmount) const {
97 void reset(SpawnRuleState& spawnRuleState) const{
106 [[nodiscard]] const SpawnCondition& spawnCondition() const noexcept {
121 [[nodiscard]] helios::engine::runtime::spawn::scheduling::SpawnPlan evaluate(
122 const helios::engine::runtime::pooling::types::GameObjectPoolId gameObjectPoolId,
123 const helios::engine::runtime::pooling::GameObjectPoolSnapshot& poolSnapshot,
124 const SpawnRuleState& spawnRuleState,
125 const helios::engine::runtime::world::GameWorld& gameWorld,
126 const helios::engine::runtime::world::UpdateContext& updateContext
128 auto amount = spawnAmountProvider_->getAmount(gameObjectPoolId, spawnRuleState, gameWorld, updateContext);
130 if (spawnCondition_->isSatisfied(amount, spawnRuleState, poolSnapshot, updateContext)) {
131 return helios::engine::runtime::spawn::scheduling::SpawnPlan{spawnRuleId_, amount};
134 return helios::engine::runtime::spawn::scheduling::SpawnPlan{spawnRuleId_, 0};
142 [[nodiscard]] helios::engine::runtime::spawn::types::SpawnRuleId spawnRuleId() const noexcept {
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.