HealthConfig Class
Fluent configuration for HealthComponent setup. More...
Declaration
Public Constructors Index
| HealthConfig (helios::engine::ecs::GameObject gameObject) | |
|
Constructs a HealthConfig and adds HealthComponent. More... | |
Public Member Functions Index
| HealthConfig & | maxHealth (const float maxHealth) |
|
Sets the maximum health value. More... | |
| HealthConfig & | lives (const size_t lives) |
|
Sets the initial number of lives. More... | |
| HealthConfig & | healthDepletedTriggers (const HealthDepletedBehavior behavior) |
|
Configures the response when health reaches zero. More... | |
Private Member Attributes Index
| helios::engine::ecs::GameObject | gameObject_ |
|
Non-owning pointer to the target GameObject. More... | |
Description
Fluent configuration for HealthComponent setup.
Automatically adds HealthComponent and provides methods for setting maximum health.
Definition at line 27 of file HealthConfig.ixx.
Public Constructors
HealthConfig()
| inline explicit |
Constructs a HealthConfig and adds HealthComponent.
- Parameters
-
<a href="/docs/helios/namespaces/helios/engine/builder/gameobject">gameObject</a> Target GameObject to configure.
Definition at line 41 of file HealthConfig.ixx.
Referenced by healthDepletedTriggers, lives and maxHealth.
Public Member Functions
healthDepletedTriggers()
| inline |
Configures the response when health reaches zero.
- Parameters
-
behavior Bitmask of HealthDepletedBehavior flags.
- Returns
Reference to this config for chaining.
Definition at line 85 of file HealthConfig.ixx.
Reference HealthConfig.
lives()
| inline |
Sets the initial number of lives.
Adds or retrieves a LivesComponent with the given count.
- Parameters
-
lives Initial life count.
- Returns
Reference to this config for chaining.
Definition at line 70 of file HealthConfig.ixx.
References HealthConfig and lives.
Referenced by lives.
maxHealth()
| inline |
Sets the maximum health value.
- Parameters
-
maxHealth The maximum health value.
- Returns
Reference to this config for chaining.
Definition at line 52 of file HealthConfig.ixx.
References HealthConfig and maxHealth.
Referenced by maxHealth.
Private Member Attributes
gameObject_
|
Non-owning pointer to the target GameObject.
Definition at line 32 of file HealthConfig.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.