29 #include "eng3d/string.hpp"
38 constexpr
EntityId<T>(T _id) noexcept :
id{ _id } { }
39 constexpr
EntityId<T>(
size_t _id) noexcept :
id{
static_cast<T
>(_id) } { }
45 constexpr operator
size_t() const noexcept {
46 return static_cast<size_t>(
id);
79 return std::hash(
id.
id);
97 constexpr
Entity() noexcept = default;
111 return Id{
static_cast<T
>(-1) };
144 constexpr
operator Id() const noexcept {
148 constexpr
operator size_t() const noexcept {
A reference to a string on the global string pool.
An entity which can only be referenced by an (presumably) unique Id this is the base class for the ot...
constexpr bool is_invalid() const
Checks if the current id is invalid.
constexpr bool is_valid() const
Checks if the current id is valid.
constexpr static bool is_valid(Id id)
Checks if the id is valid.
constexpr Id get_id() const
constexpr static bool is_invalid(Id id)
Checks if the id is not valid.
Id cached_id
Id used to speed up Id lookups on any context.
constexpr Entity() noexcept=default
constexpr static Id invalid()
Returns an invalid id.
constexpr auto operator<=>(const EntityId< T > &o) const noexcept=default
EntityId< T > operator++(int) noexcept
constexpr static T invalid_id
EntityId< T > & operator++() noexcept
constexpr auto operator==(const EntityId< T > &o) const noexcept
EntityId< T > operator--(int) noexcept
EntityId< T > & operator--() noexcept
An entity which can be referenced via a ref_name and also via id.
Eng3D::StringRef ref_name
constexpr bool operator()(const EntityId< T > &a, const EntityId< T > &b) const
std::size_t operator()(const EntityId< T > &id) const noexcept