ChaseComponent Class
Component storing chase behavior data. More...
Declaration
Public Constructors Index
| ChaseComponent ()=default | |
|
Default constructor. More... | |
| ChaseComponent (const ChaseComponent &other) | |
| ChaseComponent (ChaseComponent &&) noexcept=default | |
Public Operators Index
| ChaseComponent & | operator= (const ChaseComponent &)=default |
| ChaseComponent & | operator= (ChaseComponent &&) noexcept=default |
Public Member Functions Index
| bool | isEnabled () const noexcept |
|
Checks whether this component is enabled. More... | |
| void | enable () noexcept |
|
Enables this component. More... | |
| void | disable () noexcept |
|
Disables this component. More... | |
| helios::engine::ecs::EntityHandle | target () const noexcept |
|
Returns the target entity's handle. More... | |
| float | cooldown () const noexcept |
|
Returns the cooldown duration. More... | |
| void | setCooldown (const float cooldown) noexcept |
|
Sets the cooldown duration. More... | |
| float | cooldownTimer () const noexcept |
|
Returns the current cooldown timer value. More... | |
| void | updateCooldownTimerBy (const float delta) noexcept |
|
Advances the cooldown timer by delta time. More... | |
| void | setCooldownTimer (const float timer) noexcept |
|
Sets the cooldown timer to a specific value. More... | |
| void | setTarget (const helios::engine::ecs::EntityHandle &entityHandle) noexcept |
|
Sets the target entity to chase. More... | |
Private Member Attributes Index
| float | cooldown_ = 0.0f |
|
Time between target direction updates (seconds). More... | |
| float | cooldownTimer_ = 0.0f |
|
Current elapsed time since last update. More... | |
| helios::engine::ecs::EntityHandle | target_ {} |
|
EntityHandle of the entity to chase. More... | |
| bool | isEnabled_ = true |
|
Whether this component is enabled. More... | |
Description
Component storing chase behavior data.
Tracks a target entity by handle and controls the frequency of direction updates via a cooldown timer. Used by ChaseSystem to steer entities towards their targets.
Definition at line 27 of file ChaseComponent.ixx.
Public Constructors
ChaseComponent()
| default |
Default constructor.
Definition at line 77 of file ChaseComponent.ixx.
Referenced by ChaseComponent, ChaseComponent, operator= and operator=.
ChaseComponent()
| inline |
Definition at line 79 of file ChaseComponent.ixx.
Reference ChaseComponent.
ChaseComponent()
| noexcept default |
Definition at line 82 of file ChaseComponent.ixx.
Reference ChaseComponent.
Public Operators
operator=()
| default |
Definition at line 81 of file ChaseComponent.ixx.
Reference ChaseComponent.
operator=()
| noexcept default |
Definition at line 83 of file ChaseComponent.ixx.
Reference ChaseComponent.
Public Member Functions
cooldown()
| inline nodiscard noexcept |
Returns the cooldown duration.
- Returns
Time between direction updates in seconds.
Definition at line 99 of file ChaseComponent.ixx.
Referenced by setCooldown.
cooldownTimer()
| inline nodiscard noexcept |
Returns the current cooldown timer value.
- Returns
Elapsed time since last direction update.
Definition at line 117 of file ChaseComponent.ixx.
disable()
| inline noexcept |
Disables this component.
Definition at line 70 of file ChaseComponent.ixx.
enable()
| inline noexcept |
Enables this component.
Definition at line 63 of file ChaseComponent.ixx.
isEnabled()
| inline nodiscard noexcept |
Checks whether this component is enabled.
- Returns
True if enabled, false otherwise.
Definition at line 56 of file ChaseComponent.ixx.
setCooldown()
| inline noexcept |
Sets the cooldown duration.
- Parameters
-
cooldown Time between direction updates in seconds.
Definition at line 108 of file ChaseComponent.ixx.
Reference cooldown.
setCooldownTimer()
| inline noexcept |
Sets the cooldown timer to a specific value.
- Parameters
-
timer New timer value.
Definition at line 135 of file ChaseComponent.ixx.
setTarget()
| inline noexcept |
Sets the target entity to chase.
- Parameters
-
entityHandle The EntityHandle of the target entity.
Definition at line 144 of file ChaseComponent.ixx.
target()
| inline nodiscard noexcept |
updateCooldownTimerBy()
| inline noexcept |
Advances the cooldown timer by delta time.
- Parameters
-
delta Time to add to the timer.
Definition at line 126 of file ChaseComponent.ixx.
Private Member Attributes
cooldown_
|
Time between target direction updates (seconds).
Definition at line 32 of file ChaseComponent.ixx.
cooldownTimer_
|
Current elapsed time since last update.
Definition at line 37 of file ChaseComponent.ixx.
isEnabled_
|
Whether this component is enabled.
Definition at line 47 of file ChaseComponent.ixx.
target_
|
EntityHandle of the entity to chase.
Definition at line 42 of file ChaseComponent.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.