Skip to main content

ObserverConfig.ixx File

Configuration for observer components. More...

Included Headers

Namespaces Index

namespacehelios
namespaceengine

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

namespacebuilder

Fluent builder pattern for constructing GameObjects. More...

namespacegameObject

Factory and prototype classes for GameObject construction. More...

namespacebuilders

Domain-specific builders for configuring different aspects of GameObjects. More...

namespaceconfigs

Fine-grained configuration classes for component setup. More...

Classes Index

classObserverConfig

Fluent configuration for observer component setup. More...

Description

Configuration for observer components.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file ObserverConfig.ixx
3 * @brief Configuration for observer components.
4 */
5module;
6
7#include <cassert>
8
9export module helios.engine.builder.gameObject.builders.configs.ObserverConfig;
10
11import helios.engine.ecs.GameObject;
12
13
14import helios.engine.mechanics.match.components;
15
16import helios.engine.mechanics.scoring.components;
17import helios.engine.mechanics.scoring.types;
18import helios.engine.mechanics.timing;
19
20
22
23
24 /**
25 * @brief Fluent configuration for observer component setup.
26 *
27 * Provides methods for adding observer components that bind to
28 * data sources like score pools and game timers.
29 *
30 * @see ScoreObserverComponent
31 * @see MaxScoreObserverComponent
32 * @see GameTimerBindingComponent
33 */
35
36 /**
37 * @brief Non-owning pointer to the target GameObject.
38 */
40
41 public:
42
43 /**
44 * @brief Constructs an ObserverConfig.
45 *
46 * @param gameObject Target GameObject to configure.
47 */
49
50 }
51
52 /**
53 * @brief Adds a ScoreObserverComponent bound to the specified pool.
54 *
55 * @param scorePoolId The ID of the score pool to observe.
56 *
57 * @return Reference to this config for chaining.
58 *
59 * @deprecated use runningScore()
60 */
62 return runningScore(scorePoolId);
63 }
64
65 /**
66 * @brief Adds a ScoreObserverComponent bound to the specified pool.
67 *
68 * @param scorePoolId The ID of the score pool to observe.
69 *
70 * @return Reference to this config for chaining.
71 */
73
75
76 assert(!soc && "ScoreObserverComponent already available.");
77
79 .setScorePoolId(scorePoolId);
80 return *this;
81 }
82
83 /**
84 * @brief Adds a LivesBindingComponent observing the given entity's lives.
85 *
86 * @param gameObject The entity whose LivesComponent is observed.
87 *
88 * @return Reference to this config for chaining.
89 */
91
92 auto* loc = gameObject_.get<
94 >();
95
96 assert(!loc && "LivesBindingComponent already available.");
97
99 gameObject.entityHandle()
100 );
101 return *this;
102 }
103
104 /**
105 * @brief Adds a MaxScoreObserverComponent bound to the specified pool.
106 *
107 * @param scorePoolId The ID of the score pool to observe.
108 *
109 * @return Reference to this config for chaining.
110 */
112
114
115 assert(!soc && "MaxScoreObserverComponent already available.");
116
118 .setScorePoolId(scorePoolId);
119 return *this;
120 }
121
122 /**
123 * @brief Adds a GameTimerBindingComponent bound to the specified timer.
124 *
125 * @param gameTimerId The ID of the game timer to observe.
126 *
127 * @return Reference to this config for chaining.
128 */
130
132
133 assert(!toc && "GameTimerBindingComponent already available.");
134
136 .setGameTimerId(gameTimerId);
137 return *this;
138 }
139 };
140
141}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.