Skip to main content

ScorePoolComponent.ixx File

Component that associates an entity with a score pool. 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...

namespacescoring

Score management and tracking system for game mechanics. More...

namespacecomponents

Score-related ECS components. More...

Classes Index

classScorePoolComponent

Component that associates an entity with a score pool. More...

Description

Component that associates an entity with a score pool.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file ScorePoolComponent.ixx
3 * @brief Component that associates an entity with a score pool.
4 */
5module;
6
7
8export module helios.engine.mechanics.scoring.components.ScorePoolComponent;
9
10
11import helios.engine.mechanics.scoring.types.ScorePoolId;
12
13import helios.core.types;
14
16
17
18 /**
19 * @brief Component that associates an entity with a score pool.
20 *
21 * Attached to entities (e.g., player) to specify which score pool
22 * receives points when that entity performs scoring actions.
23 */
25
26 private:
27
28 /**
29 * @brief ID of the associated score pool.
30 */
32
33 /**
34 * @brief Whether this component is enabled.
35 */
36 bool isEnabled_ = true;
37
38
39 public:
40
41 /**
42 * @brief Checks whether this component is enabled.
43 *
44 * @return True if enabled, false otherwise.
45 */
46 [[nodiscard]] bool isEnabled() const noexcept {
47 return isEnabled_;
48 }
49
50 /**
51 * @brief Enables this component.
52 */
53 void enable() noexcept {
54 isEnabled_ = true;
55 }
56
57 /**
58 * @brief Disables this component.
59 */
60 void disable() noexcept {
61 isEnabled_ = false;
62 }
63
64 ScorePoolComponent() = default;
65
66 /**
67 * @brief Copy constructor.
68 *
69 * @param other The component to copy from.
70 */
71 ScorePoolComponent(const ScorePoolComponent& other) : scorePoolId_(other.scorePoolId_) {}
72
75 ScorePoolComponent& operator=(ScorePoolComponent&&) noexcept = default;
76
77 /**
78 * @brief Sets the associated score pool.
79 *
80 * @param scorePoolId The ID of the score pool.
81 */
82 void setScorePoolId(const helios::engine::mechanics::scoring::types::ScorePoolId scorePoolId) noexcept {
83 scorePoolId_ = scorePoolId;
84 }
85
86 /**
87 * @brief Returns the associated score pool ID.
88 *
89 * @return The ScorePoolId.
90 */
92 return scorePoolId_;
93 }
94
95 };
96
97
98}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.