Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Engine::Id Struct Reference

A strongly-typed identifier wrapper based on entt::id_type. This structure provides a type-safe wrapper around EnTT's id_type, offering implicit conversion to the underlying type for seamless integration with EnTT components. It inherits from BasicId to provide null checking and other common ID operations. More...

#include <Id.hpp>

Inheritance diagram for Engine::Id:
Engine::BasicId< Id, entt::id_type > Engine::EntityId

Public Types

using ValueType = entt::id_type

Public Member Functions

constexpr Id (ValueType value_=NullValue())
 Constructor for Id.
constexpr operator ValueType () const
 Implicit conversion operator to the underlying entt::id_type, allowing seamless use of Id instances where entt::id_type is expected.
Public Member Functions inherited from Engine::BasicId< Id, entt::id_type >
constexpr bool IsNull (void) const
 Checks if the ID is null/invalid by comparing its value to the null value defined by the derived class.

Static Public Member Functions

static constexpr ValueType NullValue (void)
 Get the null value for this ID type. This returns the null value defined by EnTT's id_type, which is typically.
static constexpr Id Null (void)
 Get a null instance of Id, which has its value set to the null value defined by NullValue().
Static Public Member Functions inherited from Engine::BasicId< Id, entt::id_type >
static constexpr Id Null (void)
 Get the null value for this ID type. This should be defined by the derived class to specify what constitutes a null/invalid ID.

Additional Inherited Members

Public Attributes inherited from Engine::BasicId< Id, entt::id_type >
entt::id_type value
 The underlying value of the ID.

Detailed Description

A strongly-typed identifier wrapper based on entt::id_type. This structure provides a type-safe wrapper around EnTT's id_type, offering implicit conversion to the underlying type for seamless integration with EnTT components. It inherits from BasicId to provide null checking and other common ID operations.

Note
Supports implicit construction from entt::id_type values
Supports implicit conversion back to entt::id_type for compatibility
Size is guaranteed to match entt::id_type through static assertion

Member Typedef Documentation

◆ ValueType

using Engine::Id::ValueType = entt::id_type

Constructor & Destructor Documentation

◆ Id()

Engine::Id::Id ( ValueType value_ = NullValue())
constexpr

Constructor for Id.

Parameters
value_The value to initialize the ID with. Defaults to the null value defined by the NullValue() method.

Member Function Documentation

◆ Null()

Id Engine::Id::Null ( void )
staticconstexpr

Get a null instance of Id, which has its value set to the null value defined by NullValue().

Returns
A null instance of Id.

◆ NullValue()

Id::ValueType Engine::Id::NullValue ( void )
staticconstexpr

Get the null value for this ID type. This returns the null value defined by EnTT's id_type, which is typically.

Returns
The value representing a null/invalid ID for this type.

◆ operator ValueType()

Engine::Id::operator Id::ValueType ( ) const
constexpr

Implicit conversion operator to the underlying entt::id_type, allowing seamless use of Id instances where entt::id_type is expected.


The documentation for this struct was generated from the following files: