Skip to main content

MaxScore2UiTextUpdateSystem Class

System for binding high score values to UI text components. More...

Declaration

class helios::engine::modules::ui::binding::systems::MaxScore2UiTextUpdateSystem { ... }

Public Member Typedefs Index

usingEngineRoleTag = helios::engine::common::tags::SystemRole

Public Member Functions Index

voidupdate (helios::engine::runtime::world::UpdateContext &updateContext) noexcept

Updates text components with current high score values. More...

Description

System for binding high score values to UI text components.

Queries entities with MaxScoreObserverComponent, NumberFormatterComponent, and UiTextComponent. When the max score observer signals an update, the formatted high score is propagated to the text component for display.

See Also

MaxScoreObserverComponent

See Also

NumberFormatterComponent

Definition at line 42 of file MaxScore2UiTextUpdateSystem.ixx.

Public Member Typedefs

EngineRoleTag

using helios::engine::modules::ui::binding::systems::MaxScore2UiTextUpdateSystem::EngineRoleTag = helios::engine::common::tags::SystemRole

Public Member Functions

update()

void helios::engine::modules::ui::binding::systems::MaxScore2UiTextUpdateSystem::update (helios::engine::runtime::world::UpdateContext & updateContext)
inline noexcept

Updates text components with current high score values.

Skips entities whose MaxScoreObserverComponent has no pending update. Otherwise formats the max score via NumberFormatterComponent and writes the result to UiTextComponent.

Parameters
updateContext

The current frame's update context.

Definition at line 57 of file MaxScore2UiTextUpdateSystem.ixx.

58
59 for (auto [entity, soc, nfc, txt, active] : updateContext.view<
64 >().whereEnabled()) {
65
66
67 if (!soc->hasUpdate()) {
68 continue;
69 }
70
71 txt->setText(nfc->format<double>(soc->maxScore()));
72 }
73 }

The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.