Skip to main content

FixedSpawnAmount.ixx File

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

Included Headers

Namespaces Index

namespacehelios
namespaceengine

Main engine module aggregating core infrastructure and game systems. More...

namespaceruntime

Runtime infrastructure for game execution and lifecycle orchestration. More...

namespacespawn

Entity spawning infrastructure for the helios engine. More...

namespacepolicy

Spawn rules, conditions, and amount providers. More...

namespaceamount

Spawn amount providers for determining spawn quantities. More...

Classes Index

classFixedSpawnAmount

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

Description

Amount provider that returns a fixed spawn count.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file FixedSpawnAmount.ixx
3 * @brief Amount provider that returns a fixed spawn count.
4 */
5module;
6
7export module helios.engine.runtime.spawn.policy.amount.FixedSpawnAmount;
8
9import helios.engine.runtime.pooling.types.GameObjectPoolId;
10import helios.engine.runtime.spawn.policy.amount.SpawnAmountProvider;
11import helios.engine.runtime.spawn.policy.SpawnRuleState;
12import helios.engine.runtime.world.GameWorld;
13import helios.engine.runtime.world.UpdateContext;
14
16
17 /**
18 * @brief Amount provider that returns a fixed spawn count.
19 *
20 * @details FixedSpawnAmount always returns the same number of entities
21 * to spawn, regardless of game state. Useful for simple, predictable
22 * spawn patterns.
23 *
24 * @see SpawnAmountProvider
25 */
27
28 /**
29 * @brief The fixed number of entities to spawn.
30 */
31 size_t amount_;
32
33 public:
34
35 /**
36 * @brief Constructs a FixedSpawnAmount with the specified count.
37 *
38 * @param amount The number of entities to spawn each time.
39 */
40 explicit FixedSpawnAmount(const size_t amount)
41 : amount_(amount) {}
42
43 /**
44 * @copydoc SpawnAmountProvider::getAmount
45 */
46 [[nodiscard]] size_t getAmount(
48 const SpawnRuleState& spawnRuleState,
51 ) const override {
52 return amount_;
53 }
54
55 };
56
57
58}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.