Skip to main content

ScoreValueConfig.ixx File

Configuration for score value components. More...

Included Headers

#include <cassert> #include <type_traits> #include <helios.engine.mechanics.scoring.components.ScoreValueComponent> #include <helios.engine.ecs.GameObject>

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

classScoreValueConfig

Fluent configuration for ScoreValueComponent setup. More...

Description

Configuration for score value components.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file ScoreValueConfig.ixx
3 * @brief Configuration for score value components.
4 */
5module;
6
7#include <cassert>
8#include <type_traits>
9
10export module helios.engine.builder.gameObject.builders.configs.ScoreValueConfig;
11
12import helios.engine.ecs.GameObject;
13
14import helios.engine.mechanics.scoring.components.ScoreValueComponent;
15
17
18
19 /**
20 * @brief Fluent configuration for ScoreValueComponent setup.
21 *
22 * Provides a template method for adding ScoreValueComponent with
23 * a specific score type (e.g., KillReward).
24 */
26
27 /**
28 * @brief Non-owning pointer to the target GameObject.
29 */
31
32 public:
33
34 /**
35 * @brief Constructs a ScoreValueConfig.
36 *
37 * @param gameObject Target GameObject to configure.
38 */
40
41 }
42
43 /**
44 * @brief Adds a ScoreValueComponent with the specified score type.
45 *
46 * @tparam T The score type (must derive from Score).
47 * @tparam Args Constructor argument types.
48 *
49 * @param args Arguments forwarded to the score type constructor.
50 *
51 * @return Reference to this config for chaining.
52 */
53 template<typename T, typename... Args>
54 ScoreValueConfig& score(Args&&... args) {
55
57
58 assert(!svc && "Component already available.");
59
60 gameObject_.add<helios::engine::mechanics::scoring::components::ScoreValueComponent<T>>(std::forward<Args>(args)...);
61
62 return *this;
63 }
64
65 };
66
67}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.