Entity Component System.
More...
#include <ECS.hpp>
◆ AddComponent() [1/2]
template<class C , typename... Args>
Ref<C> Engine::ECS::AddComponent |
( |
EntityID |
id, |
|
|
Args &&... |
args |
|
) |
| |
|
inline |
Adds a component of type C to the given entity
- Parameters
-
id | the id of the entity we want to operate on |
args | the arguments to create the type of the component |
◆ AddComponent() [2/2]
template<class C , typename... Args>
Ref<C> Engine::ECS::AddComponent |
( |
EntityID |
id, |
|
|
Ref< C > |
args |
|
) |
| |
|
inline |
Adds a component of type C to the given entity
- Parameters
-
id | the id of the entity we want to operate on |
args | the arguments to create the type of the component |
◆ GetArchetype() [1/2]
template<class... Cs>
Archetype Engine::ECS::GetArchetype |
( |
| ) |
|
|
inline |
Get an archetype from a call on multiple components
- Returns
- the Archetype
◆ GetArchetype() [2/2]
Archetype Engine::ECS::GetArchetype |
( |
EntityID |
id | ) |
|
|
inline |
Removes a component from the given entity
- Parameters
-
id | the id of the entity we want to operate on |
◆ GetComponent()
template<class C >
Ref<C> Engine::ECS::GetComponent |
( |
const EntityID & |
id | ) |
|
|
inline |
Gets a reference to a component from the given entity
- Parameters
-
id | the id of the entity we want to operate on |
◆ GetEntitiesWith() [1/2]
template<class... Cs>
std::vector<EntityID> Engine::ECS::GetEntitiesWith |
( |
| ) |
|
|
inline |
Helper to gather entities of a certail archetype
- Parameters
-
◆ GetEntitiesWith() [2/2]
std::vector<EntityID> Engine::ECS::GetEntitiesWith |
( |
Archetype |
a | ) |
|
|
inline |
Helper to gather entities of a certail archetype
- Parameters
-
◆ IsComponentRegistered()
template<class C >
bool Engine::ECS::IsComponentRegistered |
( |
| ) |
|
|
inline |
Checks if a component is registered
- Parameters
-
◆ RegisterComponent()
template<class C >
void Engine::ECS::RegisterComponent |
( |
| ) |
|
|
inline |
Registers a component type for our use later MUST be done before using a component of type C
◆ RegisterSystem()
Registers a system for us to use
- Parameters
-
- Returns
- the id of the system
◆ RemoveComponent()
template<class C >
void Engine::ECS::RemoveComponent |
( |
const EntityID & |
id | ) |
|
|
inline |
Removes a component from the given entity
- Parameters
-
id | the id of the entity we want to operate on |
◆ RemoveEntity()
void Engine::ECS::RemoveEntity |
( |
const EntityID & |
id | ) |
|
|
inline |
Removes an entity from the system
- Parameters
-
id | the id of the entity delete |
◆ RunSystem()
void Engine::ECS::RunSystem |
( |
SystemID |
sid | ) |
|
|
inline |
Runs a system
- Parameters
-
sid | the id of the target system |
◆ RunSystemArch()
void Engine::ECS::RunSystemArch |
( |
Archetype |
a | ) |
|
|
inline |
Runs several systems
- Parameters
-
a | the archetype of the target systems |
The documentation for this class was generated from the following file: