Manages entity allocation, deallocation, component masks, and lifetime tracking.
More...
#include <EntityManager.hpp>
|
| static constexpr std::size_t | MAX_ENTITIES = 10000 |
| | Maximum allowed active entities.
|
Manages entity allocation, deallocation, component masks, and lifetime tracking.
◆ EntityManager()
| EntityManager::EntityManager |
( |
| ) |
|
|
inline |
Construct a new Entity Manager object and initializes the free identifier pool.
◆ create()
| Entity EntityManager::create |
( |
| ) |
|
|
inline |
Creates a new Entity, populating it from the free ID pool.
- Returns
- The spawned Entity, or an invalid Entity if limit is reached.
◆ destroy()
| void EntityManager::destroy |
( |
Entity | e | ) |
|
|
inline |
Destroys an entity and recycles its identifier.
- Parameters
-
◆ getAlive()
| const std::vector< Entity::IdType > & EntityManager::getAlive |
( |
| ) |
const |
|
inline |
Retrieves list of currently active entity identifiers.
- Returns
- List of active entity IDs.
◆ getMask()
Retrieves the component mask of an entity.
- Parameters
-
- Returns
- Reference to component mask.
◆ alive
Tracking vector of active entity IDs.
◆ freeIds
Stack of available identifiers.
◆ masks
Array of component masks indexable by entity ID.
◆ MAX_ENTITIES
| std::size_t EntityManager::MAX_ENTITIES = 10000 |
|
staticconstexpr |
Maximum allowed active entities.
The documentation for this class was generated from the following file: