Skip to main content

SpawnRuleState.ixx File

Runtime state for a spawn rule. More...

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...

Classes Index

classSpawnRuleState

Runtime state for a spawn rule. More...

Description

Runtime state for a spawn rule.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file SpawnRuleState.ixx
3 * @brief Runtime state for a spawn rule.
4 */
5module;
6
7export module helios.engine.runtime.spawn.policy.SpawnRuleState;
8
10
11 /**
12 * @brief Runtime state for a spawn rule.
13 *
14 * @details SpawnRuleState tracks the runtime state associated with a SpawnRule,
15 * such as time since last spawn. This state is updated each frame and used by
16 * SpawnCondition to determine if spawning should occur.
17 *
18 * @see SpawnRule
19 * @see SpawnCondition
20 */
22
23 /**
24 * @brief Time elapsed since the last spawn in seconds.
25 */
26 float sinceLastSpawn_ = 0.0f;
27
28 public:
29
30 /**
31 * @brief Sets the time since last spawn.
32 *
33 * @param sinceLastSpawn Time in seconds.
34 */
35 void setSinceLastSpawn(float sinceLastSpawn) noexcept {
36 sinceLastSpawn_ = sinceLastSpawn;
37 }
38
39 /**
40 * @brief Returns the time since last spawn.
41 *
42 * @return Time in seconds since the last spawn.
43 */
44 [[nodiscard]] float sinceLastSpawn() const noexcept {
45 return sinceLastSpawn_;
46 }
47
48 /**
49 * @brief Updates the state with the frame delta time.
50 *
51 * @param deltaTime Time elapsed since last frame in seconds.
52 */
53 void update(const float deltaTime) noexcept {
54 sinceLastSpawn_ += deltaTime;
55 }
56
57 };
58
59}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.