Skip to main content

Lives2UiTextUpdateSystem Class

Updates UiTextComponents bound to a LivesComponent via LivesBindingComponent. More...

Declaration

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

Public Member Typedefs Index

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

Public Member Functions Index

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

Synchronises bound text elements with their target lives values. More...

Description

Updates UiTextComponents bound to a LivesComponent via LivesBindingComponent.

Each frame, the system compares the stored LivesRevision in the binding against the target's current revision. On mismatch the formatted lives value is written into the UiTextComponent.

Definition at line 40 of file Lives2UiTextUpdateSystem.ixx.

Public Member Typedefs

EngineRoleTag

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

Public Member Functions

update()

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

Synchronises bound text elements with their target lives values.

Parameters
updateContext

Current frame context.

Definition at line 51 of file Lives2UiTextUpdateSystem.ixx.

52
53 for (auto [entity, lbc, dfc, txt, active] : updateContext.view<
58 >().whereEnabled()) {
59
60 auto go = updateContext.find(lbc->target());
61
62 if (!go) {
63 continue;
64 }
65
66 if (auto* lc = go->get<LivesComponent>()) {
67 if (lbc->livesRevision() != lc->livesRevision()) {
68 txt->setText(dfc->format(lc->lives()));
69 lbc->setLivesRevision(lc->livesRevision());
70 }
71 }
72
73 }
74 }

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.