HealthDepletedEvent Class
Event emitted when an entity's health reaches zero. More...
Declaration
Public Constructors Index
| HealthDepletedEvent (const helios::engine::ecs::EntityHandle source, std::optional< DamageContext > damageContext=std::nullopt) | |
|
Constructs a HealthDepletedEvent. More... | |
Public Member Functions Index
| std::optional< DamageContext > | damageContext () const noexcept |
|
Returns the damage context if available. More... | |
| helios::engine::ecs::EntityHandle | source () const noexcept |
|
Returns the handle of the deceased entity. More... | |
Private Member Attributes Index
| helios::engine::ecs::EntityHandle | source_ |
|
Handle of the entity that died. More... | |
| std::optional< DamageContext > | damageContext_ |
|
Attack context if death was caused by combat. More... | |
Description
Event emitted when an entity's health reaches zero.
Contains the handle of the deceased entity and optionally the attack context if the death was caused by combat damage.
Definition at line 28 of file HealthDepletedEvent.ixx.
Public Constructors
HealthDepletedEvent()
| inline explicit |
Constructs a HealthDepletedEvent.
- Parameters
-
source Handle of the deceased entity.
damageContext Optional damage context if death was from damage applied.
Definition at line 49 of file HealthDepletedEvent.ixx.
References damageContext and source.
Public Member Functions
damageContext()
| inline nodiscard noexcept |
Returns the damage context if available.
- Returns
Optional DamageContext, or nullopt if death was not from combat.
Definition at line 59 of file HealthDepletedEvent.ixx.
Referenced by HealthDepletedEvent.
source()
| inline nodiscard noexcept |
Returns the handle of the deceased entity.
- Returns
The source entity handle.
Definition at line 68 of file HealthDepletedEvent.ixx.
Referenced by HealthDepletedEvent.
Private Member Attributes
damageContext_
|
Attack context if death was caused by combat.
Definition at line 38 of file HealthDepletedEvent.ixx.
source_
|
Handle of the entity that died.
Definition at line 33 of file HealthDepletedEvent.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.