LastDamageComponent Class
Component that stores information about the last damage received. More...
Declaration
Public Constructors Index
| LastDamageComponent ()=default | |
| LastDamageComponent (const LastDamageComponent &other)=default | |
|
Copy constructor (creates empty state). More... | |
| LastDamageComponent (LastDamageComponent &&) noexcept=default | |
Public Operators Index
| LastDamageComponent & | operator= (const LastDamageComponent &)=default |
| LastDamageComponent & | operator= (LastDamageComponent &&) 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... | |
| void | setDamageContext (const DamageContext &damageContext) noexcept |
|
Sets the last damage context. More... | |
| DamageContext | damageContext () const noexcept |
|
Returns the last damage context. More... | |
| void | reset () |
|
Resets the component to its initial state. More... | |
| void | onAcquire () noexcept |
|
Called when this entity is acquired from a pool. More... | |
| void | onRelease () noexcept |
|
Called when this entity is released back to a pool. More... | |
Private Member Attributes Index
| helios::engine::common::types::DamageContext | damageContext_ {} |
|
Context of the most recent damage received. More... | |
| bool | isEnabled_ = true |
|
Whether this component is enabled. More... | |
Description
Component that stores information about the last damage received.
Used to track which entity last dealt damage to this entity. This enables attribution of kills for scoring and other game logic. The damage context is updated by the damage system when damage is applied.
Definition at line 24 of file LastDamageComponent.ixx.
Public Constructors
LastDamageComponent()
| default |
Definition at line 63 of file LastDamageComponent.ixx.
Referenced by LastDamageComponent, LastDamageComponent, operator= and operator=.
LastDamageComponent()
| default |
Copy constructor (creates empty state).
- Parameters
-
other The component to copy from (state is not copied).
Definition at line 70 of file LastDamageComponent.ixx.
Reference LastDamageComponent.
LastDamageComponent()
| noexcept default |
Definition at line 73 of file LastDamageComponent.ixx.
Reference LastDamageComponent.
Public Operators
operator=()
| default |
Definition at line 72 of file LastDamageComponent.ixx.
Reference LastDamageComponent.
operator=()
| noexcept default |
Definition at line 74 of file LastDamageComponent.ixx.
Reference LastDamageComponent.
Public Member Functions
damageContext()
| inline nodiscard noexcept |
Returns the last damage context.
- Returns
The stored AttackContext.
Definition at line 90 of file LastDamageComponent.ixx.
Referenced by setDamageContext.
disable()
| inline noexcept |
Disables this component.
Definition at line 59 of file LastDamageComponent.ixx.
enable()
| inline noexcept |
Enables this component.
Definition at line 52 of file LastDamageComponent.ixx.
isEnabled()
| inline nodiscard noexcept |
Checks whether this component is enabled.
- Returns
True if enabled, false otherwise.
Definition at line 45 of file LastDamageComponent.ixx.
onAcquire()
| inline noexcept |
onRelease()
| inline noexcept |
reset()
| inline |
setDamageContext()
| inline noexcept |
Sets the last damage context.
- Parameters
-
damageContext The damage context to store.
Definition at line 81 of file LastDamageComponent.ixx.
References damageContext and setDamageContext.
Referenced by setDamageContext.
Private Member Attributes
damageContext_
|
Context of the most recent damage received.
Definition at line 31 of file LastDamageComponent.ixx.
isEnabled_
|
Whether this component is enabled.
Definition at line 36 of file LastDamageComponent.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.