Skip to main content

LivesBindingComponent.ixx File

Component binding a UI element to a LivesComponent on another entity. More...

Included Headers

Namespaces Index

namespacehelios
namespaceengine

Main engine module aggregating core infrastructure and game systems. More...

namespacemechanics

High-level gameplay systems and components for game logic. More...

namespacematch

Match state management for the helios engine. More...

namespacecomponents

Components for match rule tracking. More...

Classes Index

classLivesBindingComponent

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

Description

Component binding a UI element to a LivesComponent on another entity.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file LivesBindingComponent.ixx
3 * @brief Component binding a UI element to a LivesComponent on another entity.
4 */
5module;
6
7export module helios.engine.mechanics.match.components.LivesBindingComponent;
8
9import helios.engine.mechanics.match.types;
10
11import helios.engine.ecs;
12import helios.core.types;
13
14using namespace helios::engine::ecs;
16
18
19 /**
20 * @brief Binds a UI entity to the LivesComponent of a target entity.
21 *
22 * Stores the target EntityHandle and a local LivesRevision snapshot.
23 * Observer systems compare the stored revision against the target's
24 * LivesComponent revision to detect changes and update the UI.
25 */
27
28 private:
29
30 /**
31 * @brief Handle of the entity whose lives are observed.
32 */
33 EntityHandle entityHandle_;
34
35 /**
36 * @brief Last-seen lives revision for change detection.
37 */
38 LivesRevision livesRevision_;
39
40 public:
41
42 /**
43 * @brief Constructs a LivesBindingComponent.
44 *
45 * @param target Handle of the entity to observe.
46 */
48
49 /**
50 * @brief Returns the observed entity handle.
51 *
52 * @return The target EntityHandle.
53 */
54 [[nodiscard]] EntityHandle target() const noexcept {
55 return entityHandle_;
56 }
57
58 /**
59 * @brief Updates the stored lives revision.
60 *
61 * @param livesRevision New revision value.
62 */
64 livesRevision_ = livesRevision;
65 }
66
67 /**
68 * @brief Returns the stored lives revision.
69 *
70 * @return The current LivesRevision snapshot.
71 */
72 [[nodiscard]] LivesRevision livesRevision() const noexcept {
73 return livesRevision_;
74 }
75
76 };
77
78
79}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.