Skip to main content

ScoreTypeId Class

Strongly-typed identifier for score types. More...

Declaration

class helios::engine::mechanics::scoring::types::ScoreTypeId { ... }

Private Member Typedefs Index

usingScoreType = helios_engine_common_tag_ScoreTypes

Friends Index

booloperator==

Public Constructors Index

ScoreTypeId (helios::core::types::no_init_t)

Constructs an uninitialized ScoreTypeId. More...

Private Constructors Index

ScoreTypeId (const size_t id)

Private constructor for internal use. More...

Public Member Functions Index

size_tvalue () const noexcept

Returns the underlying ID value. More...

Private Member Attributes Index

size_tid_ {0}

The underlying ID value. More...

Public Static Functions Index

template <typename T>
static ScoreTypeIdid ()

Gets the ScoreTypeId for a specific component type. More...

Description

Strongly-typed identifier for score types.

Uses TypeIndexer to generate unique, monotonically increasing IDs for each score type at compile time. Suitable for use as array indices.

Definition at line 22 of file ScoreTypeId.ixx.

Private Member Typedefs

ScoreType

using helios::engine::mechanics::scoring::types::ScoreTypeId::ScoreType = helios_engine_common_tag_ScoreTypes

Definition at line 29 of file ScoreTypeId.ixx.

29 using ScoreType = helios_engine_common_tag_ScoreTypes;

Friends

operator==

friend bool ScoreTypeId, ScoreTypeId
constexpr noexcept default

Definition at line 77 of file ScoreTypeId.ixx.

Public Constructors

ScoreTypeId()

helios::engine::mechanics::scoring::types::ScoreTypeId::ScoreTypeId (helios::core::types::no_init_t)
inline explicit

Constructs an uninitialized ScoreTypeId.

Parameters
<a href="/docs/helios/structs/helios/core/types/no-init-t">helios::core::types::no_init_t</a>

Tag to indicate no initialization.

Definition at line 50 of file ScoreTypeId.ixx.

Private Constructors

ScoreTypeId()

helios::engine::mechanics::scoring::types::ScoreTypeId::ScoreTypeId (const size_t id)
inline explicit

Private constructor for internal use.

Parameters
id

The type ID value.

Definition at line 41 of file ScoreTypeId.ixx.

41 explicit ScoreTypeId(const size_t id) : id_(id) {}

Public Member Functions

value()

size_t helios::engine::mechanics::scoring::types::ScoreTypeId::value ()
inline nodiscard noexcept

Returns the underlying ID value.

Returns

The numeric type ID, suitable for use as an array index.

Definition at line 57 of file ScoreTypeId.ixx.

57 [[nodiscard]] size_t value() const noexcept {
58 return id_;
59 }

Referenced by helios::engine::mechanics::scoring::ScorePool::addScore and helios::engine::mechanics::scoring::systems::CombatScoringSystem::update.

Private Member Attributes

id_

size_t helios::engine::mechanics::scoring::types::ScoreTypeId::id_ {0}

The underlying ID value.

Definition at line 34 of file ScoreTypeId.ixx.

34 size_t id_{0};

Public Static Functions

id()

template <typename T>
ScoreTypeId helios::engine::mechanics::scoring::types::ScoreTypeId::id ()
inline nodiscard static

Gets the ScoreTypeId for a specific component type.

Uses TypeIndexer to generate a unique, monotonically increasing ID for each component type. The ID is generated once per type and cached.

Template Parameters
T

The component type. Must be a concrete type (not abstract).

Returns

The unique ScoreTypeId for type T.

Definition at line 72 of file ScoreTypeId.ixx.

72 [[nodiscard]] static ScoreTypeId id() {
74 return ScoreTypeId(tid);
75 }

Reference helios::core::data::TypeIndexer< Group >::typeIndex.

Referenced by helios::engine::mechanics::scoring::types::KillReward::typeId and helios::engine::mechanics::scoring::systems::CombatScoringSystem::update.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.