Skip to main content

HealthUpdateClearSystem.ixx File

System that clears the dirty flag on HealthComponents each frame. More...

Included Headers

Namespaces Index

namespacehelios
namespaceengine

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

namespacemechanics

High-level gameplay systems and components for game logic. More...

namespacehealth

Health management system for game entities. More...

namespacesystems

Systems for health processing. More...

Classes Index

classHealthUpdateClearSystem

Clears the dirty flag on every active HealthComponent. More...

Description

System that clears the dirty flag on HealthComponents each frame.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file HealthUpdateClearSystem.ixx
3 * @brief System that clears the dirty flag on HealthComponents each frame.
4 */
5module;
6
7#include <cassert>
8#include <format>
9
10
11export module helios.engine.mechanics.health.systems.HealthUpdateClearSystem;
12
13import helios.engine.runtime.world.GameWorld;
14import helios.engine.runtime.world.UpdateContext;
15
16
17
18import helios.engine.mechanics.lifecycle.components.Active;
19
20import helios.engine.mechanics.health.components;
21
22
23import helios.engine.common.tags.SystemRole;
24
26
27 /**
28 * @brief Clears the dirty flag on every active HealthComponent.
29 *
30 * Should run after all health-related observers have processed the
31 * current frame so that stale change notifications are discarded.
32 */
34
35 public:
36
38 /**
39 * @brief Iterates all active HealthComponents and resets their dirty state.
40 *
41 * @param updateContext Current frame context.
42 */
44
45 for (auto [entity, hc, active] : updateContext.view<
48 >().whereEnabled()) {
49 hc->clearDirty();
50 }
51
52 }
53
54 };
55
56}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.