FECS
|
Acts as a main interface for the ECS, manages a **Local**
environment for entities, and component manipulation.
More...
#include <registry.h>
Public Member Functions | |
Registry () | |
Constructs a new Registry Instance. | |
Entity | CreateEntity () |
Creates a new Entity. | |
void | DestroyEntity (Entity id) |
Destroys an Entity and Removes its components. | |
bool | IsEntityAlive (Entity id) const |
Checks whether the given entity is still alive. | |
EntityManager & | GetEntityManager () |
Get the local entity manager. | |
void | Reserve (std::size_t size) |
Reserve a predicted amount of components. | |
template<typename T> | |
Container::SparseSet< T > & | RegisterComponent () |
Registers a new Component Type and returns its Pool. | |
template<typename T> | |
Container::SparseSet< T > & | GetPool () |
Retrieves the pool for a given component type. | |
template<typename T> | |
void | Attach (Entity e, const T &component) |
Attachs a component to an entity. | |
template<typename T> | |
T & | Get (Entity e) |
Retrieves a component reference attached to an entity. | |
template<typename T> | |
void | Detach (Entity e) |
Detaches a component from an entity. | |
template<typename T> | |
bool | Has (Entity e) |
Checks if a given component type exists on an entity. | |
template<typename... C> | |
FECS::View< C... > | View () |
Creates a view for the specified component types. | |
Acts as a main interface for the ECS, manages a **Local**
environment for entities, and component manipulation.
The registry handes entity creation and destruction, component attachment/detachment, exposes access to Component Pool and Views
|
inline |
Attachs a component to an entity.
T | The component type. |
e | The target entity. |
component | The component to attach. |
|
inline |
|
inline |
Destroys an Entity and Removes its components.
id | The ID of the entity to destroy. |
|
inline |
Detaches a component from an entity.
T | The component type. |
e | The target entity |
|
inline |
Retrieves a component reference attached to an entity.
T | The component type. |
e | The target entity. |
|
inline |
Get the local entity manager.
|
inline |
Retrieves the pool for a given component type.
T | The component type. |
RegisterComponent<T>()
to avoid that cost.
|
inline |
Checks if a given component type exists on an entity.
T | The component type. |
e | The target entity. |
|
inline |
Checks whether the given entity is still alive.
id | The ID of the entity to check. |
|
inline |
Registers a new Component Type and returns its Pool.
T | The component type. |
|
inline |
Reserve a predicted amount of components.
size | The number of predicted components |
|
inline |
Creates a view for the specified component types.
C... | The component types to include in the view. |