ScorePool.ixx File
Container for accumulated scores by type. More...
Included Headers
#include <stdexcept>
#include <unordered_map>
#include <helios.core.types>
#include <helios.engine.mechanics.scoring.types.ScorePoolId>
#include <helios.engine.mechanics.scoring.types>
#include <helios.engine.mechanics.scoring.MaxScorePoolSnapshot>
#include <helios.engine.mechanics.scoring.ScorePoolSnapshot>
Namespaces Index
| namespace | helios |
| namespace | engine |
|
Main engine module aggregating core infrastructure and game systems. More... | |
| namespace | mechanics |
|
High-level gameplay systems and components for game logic. More... | |
| namespace | scoring |
|
Score management and tracking system for game mechanics. More... | |
Classes Index
| class | ScorePool |
|
Container that accumulates scores by type within a pool. More... | |
Description
Container for accumulated scores by type.
File Listing
The file content with the documentation metadata removed is:
22export namespace helios::engine::mechanics::scoring {
44 helios::engine::mechanics::scoring::types::ScorePoolId scorePoolId_;
64 helios::engine::mechanics::scoring::types::ScorePoolRevision maxScoreRevision_{};
87 helios::engine::mechanics::scoring::types::ScorePoolRevision revision_{};
96 explicit ScorePool(const helios::engine::mechanics::scoring::types::ScorePoolId scorePoolId)
97 : scorePoolId_{scorePoolId} {}
104 [[nodiscard]] helios::engine::mechanics::scoring::types::ScorePoolId id() const noexcept {
115 void addScore(const helios::engine::mechanics::scoring::types::ScoreValueContext& scoreContext) {
117 auto id = scoreContext.scoreTypeId.value();
123 const double oldScore = scores_[id];
128 addTotal(scoreContext.value);
129 updateMaxScore();
147 [[nodiscard]] double totalScore() const noexcept {
156 [[nodiscard]] helios::engine::mechanics::scoring::types::ScorePoolId scorePoolId() const noexcept {
168 [[nodiscard]] helios::engine::mechanics::scoring::types::ScorePoolRevision revision() const noexcept {
180 [[nodiscard]] helios::engine::mechanics::scoring::ScorePoolSnapshot snapshot() const noexcept {
191 void updateMaxScore() noexcept {
213 [[nodiscard]] helios::engine::mechanics::scoring::types::ScorePoolRevision maxScoreRevision() const noexcept {
224 [[nodiscard]] helios::engine::mechanics::scoring::MaxScorePoolSnapshot maxScoreSnapshot() const noexcept {
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.