health Folder
Folders Index
| folder | components |
| folder | events |
| folder | systems |
| folder | types |
Files Index
| file | helios/engine/mechanics/health/_module.ixx |
|
Module facade for the health system. More... | |
| file | HealthManager.ixx |
|
Manager for processing damage commands and emitting health events. More... | |
| file | mechanics/health/registry.ixx |
|
Component registration for health module. More... | |
Description
helios::engine::mechanics::health
Health management system for game entities.
This module provides components, events, types, systems, and a manager for tracking entity health, processing damage, and handling death.
Submodules
| Submodule | Purpose |
|---|---|
| HealthManager | Manager that processes ApplyDamageCommands in batch during flush |
| components/ | Health-related ECS components |
| events/ | Health-related events (update, depletion) |
| systems/ | Systems for health processing |
| types/ | Bitmask enums and context structs |
Architecture
1. HealthComponent tracks current/maximum health and carries behaviour flags 2. HealthManager receives ApplyDamageCommands via submit() and processes them in batch during the manager flush phase:
- Applies damage to the target's HealthComponent
- Pushes a HealthChangedEvent to the phase bus (available next phase)
- On health depletion, evaluates HealthDepletedBehavior flags and optionally attaches a DeadTagComponent (flag DeadTag)
- Pushes a HealthDepletedEvent to the pass bus (available after commit within the same pass) 3. HealthUpdateClearSystem resets the dirty flag after observers have run
Key Types
- HealthChangeBehavior – selects the event bus for health-change reporting
- HealthDepletedBehavior – selects actions on health depletion (event, despawn, dead-tag)
- HealthChangeContext – carries target, source, contact point, and amount
Integration
The health system integrates with:
- Combat system – ApplyDamageCommand is routed to HealthManager
- Scoring system – HealthDepletedEvent triggers score awards
- Lifecycle system – GameObjectLifecycleSystem reads depletion events and despawns entities
- Spawn system – dead entities are returned to pools via DespawnCommand
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.