ScoreValueComponent Class Template
Template component that stores a score value of a specific type. More...
Declaration
Public Constructors Index
template <typename... Args> | |
| ScoreValueComponent (Args &&... args) | |
|
Constructs a ScoreValueComponent with forwarded arguments. More... | |
template <typename T> | |
| ScoreValueComponent (const ScoreValueComponent &other) | |
|
Copy constructor. More... | |
template <typename T> | |
| ScoreValueComponent (ScoreValueComponent &&other) noexcept=default | |
Public Operators Index
template <typename T> | |
| ScoreValueComponent & | operator= (const ScoreValueComponent &other)=default |
template <typename T> | |
| ScoreValueComponent & | operator= (ScoreValueComponent &&other) noexcept=default |
Public Member Functions Index
template <typename T> | |
| bool | isEnabled () const noexcept |
|
Checks whether this component is enabled. More... | |
template <typename T> | |
| void | enable () noexcept |
|
Enables this component. More... | |
template <typename T> | |
| void | disable () noexcept |
|
Disables this component. More... | |
template <typename T> | |
| T | score () const noexcept |
|
Returns the stored score value. More... | |
Private Member Attributes Index
template <typename T> | |
| T | score_ {} |
|
The score value instance. More... | |
template <typename T> | |
| bool | isEnabled_ = true |
|
Whether this component is enabled. More... | |
Description
Template component that stores a score value of a specific type.
Attached to entities to define the score value awarded when that entity is involved in a scoring event (e.g., enemy killed). The template parameter must derive from Score.
- Template Parameters
-
T The score type (must derive from Score).
Definition at line 28 of file ScoreValueComponent.ixx.
Public Constructors
ScoreValueComponent()
| inline explicit |
Constructs a ScoreValueComponent with forwarded arguments.
- Template Parameters
-
Args Argument types for Score construction.
- Parameters
-
args Arguments forwarded to the Score constructor.
Definition at line 75 of file ScoreValueComponent.ixx.
Referenced by helios::engine::mechanics::scoring::components::ScoreValueComponent< T >::operator=, helios::engine::mechanics::scoring::components::ScoreValueComponent< T >::operator=, helios::engine::mechanics::scoring::components::ScoreValueComponent< T >::ScoreValueComponent and helios::engine::mechanics::scoring::components::ScoreValueComponent< T >::ScoreValueComponent.
ScoreValueComponent()
| inline |
Copy constructor.
- Parameters
-
other The component to copy from.
Definition at line 82 of file ScoreValueComponent.ixx.
Reference helios::engine::mechanics::scoring::components::ScoreValueComponent< T >::ScoreValueComponent.
ScoreValueComponent()
| noexcept default |
Definition at line 86 of file ScoreValueComponent.ixx.
Reference helios::engine::mechanics::scoring::components::ScoreValueComponent< T >::ScoreValueComponent.
Public Operators
operator=()
| default |
Definition at line 84 of file ScoreValueComponent.ixx.
Reference helios::engine::mechanics::scoring::components::ScoreValueComponent< T >::ScoreValueComponent.
operator=()
| noexcept default |
Definition at line 87 of file ScoreValueComponent.ixx.
Reference helios::engine::mechanics::scoring::components::ScoreValueComponent< T >::ScoreValueComponent.
Public Member Functions
disable()
| inline noexcept |
Disables this component.
Definition at line 64 of file ScoreValueComponent.ixx.
enable()
| inline noexcept |
Enables this component.
Definition at line 57 of file ScoreValueComponent.ixx.
isEnabled()
| inline nodiscard noexcept |
Checks whether this component is enabled.
- Returns
True if enabled, false otherwise.
Definition at line 50 of file ScoreValueComponent.ixx.
score()
| inline nodiscard noexcept |
Returns the stored score value.
- Returns
The score instance.
Definition at line 96 of file ScoreValueComponent.ixx.
Private Member Attributes
isEnabled_
|
Whether this component is enabled.
Definition at line 40 of file ScoreValueComponent.ixx.
score_
|
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.