Nebula
|
#include <entity.h>
An entity is essentially just an Id with some utility functions attached.
What actually makes up the entities are their components.
The id is split into two parts: The upper half is world id, the upper 10 bits of the lower half are used as a generation counter, so that we can easily reuse the lowest 22 bits as an index.
Classes | |
struct | Traits |
Public Member Functions | |
Entity ()=default | |
constexpr | Entity (uint64_t id) |
constexpr | Entity (uint32_t world, uint32_t generation, uint32_t index) |
constexpr | operator Ids::Id64 () const |
constexpr uint32_t | HashCode () const |
Entity & | operator= (uint64_t rhs) |
const bool | operator== (const Entity &rhs) const |
const bool | operator!= (const Entity &rhs) const |
const bool | operator< (const Entity &rhs) const |
const bool | operator> (const Entity &rhs) const |
Static Public Member Functions | |
static constexpr Entity | FromId (Ids::Id64 id) |
static constexpr Entity | Invalid () |
Public Attributes | |
uint32_t | index: 22 |
uint32_t | generation: 10 |
uint32_t | world: 8 |
uint32_t | reserved: 24 |
|
default |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlinestaticconstexpr |
|
explicitconstexpr |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
uint32_t Game::Entity::generation |
uint32_t Game::Entity::index |
uint32_t Game::Entity::reserved |
uint32_t Game::Entity::world |