Skip to main content

LivesBindingComponent Class

Binds a UI entity to the LivesComponent of a target entity. More...

Declaration

class helios::engine::mechanics::match::components::LivesBindingComponent { ... }

Public Constructors Index

LivesBindingComponent (EntityHandle target)

Constructs a LivesBindingComponent. More...

Public Member Functions Index

EntityHandletarget () const noexcept

Returns the observed entity handle. More...

voidsetLivesRevision (const LivesRevision livesRevision) noexcept

Updates the stored lives revision. More...

LivesRevisionlivesRevision () const noexcept

Returns the stored lives revision. More...

Private Member Attributes Index

EntityHandleentityHandle_

Handle of the entity whose lives are observed. More...

LivesRevisionlivesRevision_

Last-seen lives revision for change detection. More...

Description

Binds a UI entity to the LivesComponent of a target entity.

Stores the target EntityHandle and a local LivesRevision snapshot. Observer systems compare the stored revision against the target's LivesComponent revision to detect changes and update the UI.

Definition at line 26 of file LivesBindingComponent.ixx.

Public Constructors

LivesBindingComponent()

helios::engine::mechanics::match::components::LivesBindingComponent::LivesBindingComponent (EntityHandle target)
inline

Constructs a LivesBindingComponent.

Parameters
target

Handle of the entity to observe.

Definition at line 47 of file LivesBindingComponent.ixx.

Reference target.

Public Member Functions

livesRevision()

LivesRevision helios::engine::mechanics::match::components::LivesBindingComponent::livesRevision ()
inline nodiscard noexcept

Returns the stored lives revision.

Returns

The current LivesRevision snapshot.

Definition at line 72 of file LivesBindingComponent.ixx.

72 [[nodiscard]] LivesRevision livesRevision() const noexcept {
73 return livesRevision_;
74 }

Referenced by setLivesRevision.

setLivesRevision()

void helios::engine::mechanics::match::components::LivesBindingComponent::setLivesRevision (const LivesRevision livesRevision)
inline noexcept

Updates the stored lives revision.

Parameters
livesRevision

New revision value.

Definition at line 63 of file LivesBindingComponent.ixx.

64 livesRevision_ = livesRevision;
65 }

Reference livesRevision.

target()

EntityHandle helios::engine::mechanics::match::components::LivesBindingComponent::target ()
inline nodiscard noexcept

Returns the observed entity handle.

Returns

The target EntityHandle.

Definition at line 54 of file LivesBindingComponent.ixx.

54 [[nodiscard]] EntityHandle target() const noexcept {
55 return entityHandle_;
56 }

Referenced by LivesBindingComponent.

Private Member Attributes

entityHandle_

EntityHandle helios::engine::mechanics::match::components::LivesBindingComponent::entityHandle_

Handle of the entity whose lives are observed.

Definition at line 33 of file LivesBindingComponent.ixx.

33 EntityHandle entityHandle_;

livesRevision_

LivesRevision helios::engine::mechanics::match::components::LivesBindingComponent::livesRevision_

Last-seen lives revision for change detection.

Definition at line 38 of file LivesBindingComponent.ixx.

38 LivesRevision livesRevision_;

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.