Skip to main content

ObserverConfig Class

Fluent configuration for observer component setup. More...

Declaration

class helios::engine::builder::gameObject::builders::configs::ObserverConfig { ... }

Public Constructors Index

ObserverConfig (helios::engine::ecs::GameObject gameObject)

Constructs an ObserverConfig. More...

Public Member Functions Index

ObserverConfig &scorePool (const helios::engine::mechanics::scoring::types::ScorePoolId scorePoolId)

Adds a ScoreObserverComponent bound to the specified pool. More...

ObserverConfig &runningScore (const helios::engine::mechanics::scoring::types::ScorePoolId scorePoolId)

Adds a ScoreObserverComponent bound to the specified pool. More...

ObserverConfig &lives (const helios::engine::ecs::GameObject gameObject)

Adds a LivesBindingComponent observing the given entity's lives. More...

ObserverConfig &maxScore (const helios::engine::mechanics::scoring::types::ScorePoolId scorePoolId)

Adds a MaxScoreObserverComponent bound to the specified pool. More...

ObserverConfig &time (const helios::engine::mechanics::timing::types::GameTimerId gameTimerId)

Adds a GameTimerBindingComponent bound to the specified timer. More...

Private Member Attributes Index

helios::engine::ecs::GameObjectgameObject_

Non-owning pointer to the target GameObject. More...

Description

Fluent configuration for observer component setup.

Provides methods for adding observer components that bind to data sources like score pools and game timers.

See Also

ScoreObserverComponent

See Also

MaxScoreObserverComponent

See Also

GameTimerBindingComponent

Definition at line 34 of file ObserverConfig.ixx.

Public Constructors

ObserverConfig()

helios::engine::builder::gameObject::builders::configs::ObserverConfig::ObserverConfig (helios::engine::ecs::GameObject gameObject)
inline explicit

Constructs an ObserverConfig.

Parameters
<a href="/docs/helios/namespaces/helios/engine/builder/gameobject">gameObject</a>

Target GameObject to configure.

Definition at line 48 of file ObserverConfig.ixx.

Referenced by lives, maxScore, runningScore, scorePool and time.

Public Member Functions

lives()

ObserverConfig & helios::engine::builder::gameObject::builders::configs::ObserverConfig::lives (const helios::engine::ecs::GameObject gameObject)
inline

Adds a LivesBindingComponent observing the given entity's lives.

Parameters
<a href="/docs/helios/namespaces/helios/engine/builder/gameobject">gameObject</a>

The entity whose LivesComponent is observed.

Returns

Reference to this config for chaining.

Definition at line 90 of file ObserverConfig.ixx.

91
92 auto* loc = gameObject_.get<
94 >();
95
96 assert(!loc && "LivesBindingComponent already available.");
97
99 gameObject.entityHandle()
100 );
101 return *this;
102 }

Reference ObserverConfig.

maxScore()

ObserverConfig & helios::engine::builder::gameObject::builders::configs::ObserverConfig::maxScore (const helios::engine::mechanics::scoring::types::ScorePoolId scorePoolId)
inline

Adds a MaxScoreObserverComponent bound to the specified pool.

Parameters
scorePoolId

The ID of the score pool to observe.

Returns

Reference to this config for chaining.

Definition at line 111 of file ObserverConfig.ixx.

112
114
115 assert(!soc && "MaxScoreObserverComponent already available.");
116
118 .setScorePoolId(scorePoolId);
119 return *this;
120 }

Reference ObserverConfig.

runningScore()

ObserverConfig & helios::engine::builder::gameObject::builders::configs::ObserverConfig::runningScore (const helios::engine::mechanics::scoring::types::ScorePoolId scorePoolId)
inline

Adds a ScoreObserverComponent bound to the specified pool.

Parameters
scorePoolId

The ID of the score pool to observe.

Returns

Reference to this config for chaining.

Definition at line 72 of file ObserverConfig.ixx.

73
75
76 assert(!soc && "ScoreObserverComponent already available.");
77
79 .setScorePoolId(scorePoolId);
80 return *this;
81 }

Reference ObserverConfig.

Referenced by scorePool.

scorePool()

ObserverConfig & helios::engine::builder::gameObject::builders::configs::ObserverConfig::scorePool (const helios::engine::mechanics::scoring::types::ScorePoolId scorePoolId)
inline

Adds a ScoreObserverComponent bound to the specified pool.

Parameters
scorePoolId

The ID of the score pool to observe.

Returns

Reference to this config for chaining.

Definition at line 61 of file ObserverConfig.ixx.

References ObserverConfig and runningScore.

time()

ObserverConfig & helios::engine::builder::gameObject::builders::configs::ObserverConfig::time (const helios::engine::mechanics::timing::types::GameTimerId gameTimerId)
inline

Adds a GameTimerBindingComponent bound to the specified timer.

Parameters
gameTimerId

The ID of the game timer to observe.

Returns

Reference to this config for chaining.

Definition at line 129 of file ObserverConfig.ixx.

130
132
133 assert(!toc && "GameTimerBindingComponent already available.");
134
136 .setGameTimerId(gameTimerId);
137 return *this;
138 }

Reference ObserverConfig.

Private Member Attributes

gameObject_

helios::engine::ecs::GameObject helios::engine::builder::gameObject::builders::configs::ObserverConfig::gameObject_

Non-owning pointer to the target GameObject.

Definition at line 39 of file ObserverConfig.ixx.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.