MaxScoreObserverComponent Class
Component that observes and caches the high score value from a ScorePool. More...
Declaration
Friends Index
| class | helios::engine::mechanics::scoring::systems::MaxScoreObserverClearSystem |
Public Constructors Index
| MaxScoreObserverComponent ()=default | |
| MaxScoreObserverComponent (const MaxScoreObserverComponent &other) | |
|
Copy constructor. More... | |
| MaxScoreObserverComponent (MaxScoreObserverComponent &&) noexcept=default | |
Public Operators Index
| MaxScoreObserverComponent & | operator= (const MaxScoreObserverComponent &)=default |
| MaxScoreObserverComponent & | operator= (MaxScoreObserverComponent &&) 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 | setScorePoolId (const ScorePoolId scorePoolId) noexcept |
|
Sets the score pool to observe. More... | |
| ScorePoolId | scorePoolId () const noexcept |
|
Returns the observed score pool ID. More... | |
| void | setMaxScorePoolSnapshot (const helios::engine::mechanics::scoring::MaxScorePoolSnapshot &snapshot) noexcept |
|
Sets the cached snapshot value. More... | |
| ScorePoolRevision | scorePoolRevision () const noexcept |
|
Returns the cached score pool revision. More... | |
| double | maxScore () const noexcept |
|
Returns the cached max score. More... | |
| bool | hasUpdate () const noexcept |
|
Checks if the value changed since last clear. More... | |
Private Member Functions Index
| void | clearUpdate () |
|
Clears the update flag. More... | |
Private Member Attributes Index
| ScorePoolId | scorePoolId_ {helios::core::types::no_init} |
|
ID of the score pool to observe. More... | |
| bool | hasUpdate_ = true |
|
Flag indicating whether the value changed this frame. More... | |
| MaxScorePoolSnapshot | snapshot_ |
|
the current snapshot saved by this observer component. More... | |
| bool | isEnabled_ = true |
|
Whether this component is enabled. More... | |
Description
Component that observes and caches the high score value from a ScorePool.
Attached to UI entities to display high score values. The MaxScoreObserverUpdateSystem updates this component's snapshot from the referenced ScorePool each frame. The hasUpdate flag indicates when the value has changed.
- See Also
MaxScoreObserverUpdateSystem
- See Also
- See Also
Definition at line 35 of file MaxScoreObserverComponent.ixx.
Friends
helios::engine::mechanics::scoring::systems::MaxScoreObserverClearSystem
Definition at line 38 of file MaxScoreObserverComponent.ixx.
Reference helios::core::types::no_init.
Public Constructors
MaxScoreObserverComponent()
| default |
Definition at line 99 of file MaxScoreObserverComponent.ixx.
Referenced by MaxScoreObserverComponent, MaxScoreObserverComponent, operator= and operator=.
MaxScoreObserverComponent()
| inline |
Copy constructor.
- Parameters
-
other The component to copy from.
Definition at line 106 of file MaxScoreObserverComponent.ixx.
Reference MaxScoreObserverComponent.
MaxScoreObserverComponent()
| noexcept default |
Definition at line 110 of file MaxScoreObserverComponent.ixx.
Reference MaxScoreObserverComponent.
Public Operators
operator=()
| default |
Definition at line 109 of file MaxScoreObserverComponent.ixx.
Reference MaxScoreObserverComponent.
operator=()
| noexcept default |
Definition at line 111 of file MaxScoreObserverComponent.ixx.
Reference MaxScoreObserverComponent.
Public Member Functions
disable()
| inline noexcept |
Disables this component.
Definition at line 95 of file MaxScoreObserverComponent.ixx.
enable()
| inline noexcept |
Enables this component.
Definition at line 88 of file MaxScoreObserverComponent.ixx.
hasUpdate()
| inline nodiscard noexcept |
Checks if the value changed since last clear.
- Returns
True if the value was updated this frame.
Definition at line 169 of file MaxScoreObserverComponent.ixx.
isEnabled()
| inline nodiscard noexcept |
Checks whether this component is enabled.
- Returns
True if enabled, false otherwise.
Definition at line 81 of file MaxScoreObserverComponent.ixx.
maxScore()
| inline nodiscard noexcept |
Returns the cached max score.
- Returns
The current high score value.
Definition at line 160 of file MaxScoreObserverComponent.ixx.
scorePoolId()
| inline nodiscard noexcept |
Returns the observed score pool ID.
- Returns
The ScorePoolId.
Definition at line 127 of file MaxScoreObserverComponent.ixx.
Referenced by setScorePoolId.
scorePoolRevision()
| inline nodiscard noexcept |
Returns the cached score pool revision.
- Returns
The revision of the last observed snapshot.
Definition at line 151 of file MaxScoreObserverComponent.ixx.
setMaxScorePoolSnapshot()
| inline noexcept |
Sets the cached snapshot value.
Sets hasUpdate to true if the value changes.
- Parameters
-
snapshot The snapshot to use for the next update.
Definition at line 138 of file MaxScoreObserverComponent.ixx.
setScorePoolId()
| inline noexcept |
Sets the score pool to observe.
- Parameters
-
scorePoolId The ID of the pool to observe.
Definition at line 118 of file MaxScoreObserverComponent.ixx.
References scorePoolId and setScorePoolId.
Referenced by setScorePoolId.
Private Member Functions
clearUpdate()
| inline |
Clears the update flag.
Called by MaxScoreObserverClearSystem.
Definition at line 70 of file MaxScoreObserverComponent.ixx.
Private Member Attributes
hasUpdate_
|
Flag indicating whether the value changed this frame.
Cleared by MaxScoreObserverClearSystem at frame end.
Definition at line 53 of file MaxScoreObserverComponent.ixx.
isEnabled_
|
Whether this component is enabled.
Definition at line 63 of file MaxScoreObserverComponent.ixx.
scorePoolId_
|
ID of the score pool to observe.
Definition at line 45 of file MaxScoreObserverComponent.ixx.
snapshot_
|
the current snapshot saved by this observer component.
Definition at line 58 of file MaxScoreObserverComponent.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.