63 const std::vector<Entity::IdType>&
getAlive()
const {
69 std::vector<Entity::IdType>
alive;
73 std::array<ComponentMask, MAX_ENTITIES>
masks;
std::bitset< MAX_COMPONENTS > ComponentMask
Bitmask representing component registration status.
Definition Entity.hpp:55
Lightweight identifier representing a game object in the Entity Component System.
Definition Entity.hpp:11
static constexpr IdType INVALID_ENTITY
Constant representing a null or invalid entity.
Definition Entity.hpp:16
IdType getId() const
Retrieve the raw identifier of the entity.
Definition Entity.hpp:32
std::uint32_t IdType
Numeric type of the entity identifier.
Definition Entity.hpp:14
static constexpr std::size_t MAX_ENTITIES
Maximum allowed active entities.
Definition EntityManager.hpp:16
Entity create()
Creates a new Entity, populating it from the free ID pool.
Definition EntityManager.hpp:30
ComponentMask & getMask(Entity e)
Retrieves the component mask of an entity.
Definition EntityManager.hpp:55
EntityManager()
Construct a new Entity Manager object and initializes the free identifier pool.
Definition EntityManager.hpp:21
void destroy(Entity e)
Destroys an entity and recycles its identifier.
Definition EntityManager.hpp:43
std::stack< Entity::IdType > freeIds
Stack of available identifiers.
Definition EntityManager.hpp:71
const std::vector< Entity::IdType > & getAlive() const
Retrieves list of currently active entity identifiers.
Definition EntityManager.hpp:63
std::vector< Entity::IdType > alive
Tracking vector of active entity IDs.
Definition EntityManager.hpp:69
std::array< ComponentMask, MAX_ENTITIES > masks
Array of component masks indexable by entity ID.
Definition EntityManager.hpp:73