5#include "core/memory/types.h"
27 constexpr explicit operator bool() const noexcept {
return bool(key); }
29 constexpr bool operator==(
const EntityId& other)
const noexcept {
30 return key == other.key;
32 constexpr bool operator!=(
const EntityId& other)
const noexcept {
33 return key != other.key;
36 constexpr uint32_t slot() const noexcept {
return key.
index; }
38 constexpr uint32_t generation() const noexcept {
return key.generation; }
41static_assert(
sizeof(
EntityId) == 8,
"EntityId must be 8 bytes");
Names one entity of one Scene, for as long as that slot holds it.
Definition entity.h:23
Opaque handle pairing a sparse-array index with a generation counter.
Definition types.h:14
uint32_t index
Sparse slot index; 0 is null.
Definition types.h:15