Provides static access to component pools and handles entity cleanup.
More...
#include <component_manager.h>
|
template<typename T> |
static Container::SparseSet< T > & | GetPool (EntityManager *manager) |
| Get the component pool for a specific component type.
|
|
template<typename T> |
static std::uint32_t & | GetVersion () |
| Returns a per-type version reference for tracking changes.
|
|
static void | Reserve (std::size_t size) |
| Reserves storage space for predicted number of component types.
|
|
static void | DeleteEntity (Entity e) |
| Removes an entity from all registered component pools.
|
|
static void | ClearRegistry () |
| Clears all component pools and resets internal state.
|
|
Provides static access to component pools and handles entity cleanup.
The ComponentManager is a singleton-like utility with static methods and per-type static storage (via Templates) to manage components, and versions efficiently.
◆ ClearRegistry()
static void FECS::Manager::ComponentManager::ClearRegistry |
( |
| ) |
|
|
inlinestatic |
Clears all component pools and resets internal state.
Typically used in testing or to reset the ECS state.
◆ DeleteEntity()
static void FECS::Manager::ComponentManager::DeleteEntity |
( |
Entity | e | ) |
|
|
inlinestatic |
Removes an entity from all registered component pools.
Used during entity destruction to clean up attached components.
- Parameters
-
◆ GetPool()
Get the component pool for a specific component type.
If the pool doesnt exist yet, it's created and registered.
- Template Parameters
-
- Parameters
-
- Returns
- Reference to the SparseSet for type T.
- Note
- This is a raw method to get the entity manager, its already handled via the Registry.
◆ GetVersion()
template<typename T>
static std::uint32_t & FECS::Manager::ComponentManager::GetVersion |
( |
| ) |
|
|
inlinestatic |
Returns a per-type version reference for tracking changes.
Used to invalidate views and other systems when component data changes.
- Template Parameters
-
- Returns
- Reference to a static version counter.
◆ Reserve()
static void FECS::Manager::ComponentManager::Reserve |
( |
std::size_t | size | ) |
|
|
inlinestatic |
Reserves storage space for predicted number of component types.
- Parameters
-
size | Number of components to reserve for |
- Note
- This is a raw method to reserve components, its already handled via the Registry.
The documentation for this class was generated from the following file: