ecs::Registry
Last updated
Last updated
#include <Registry.hpp>
void
template <typename Component > void
[This is the core of the ECS]
This class contains many feature as follows :
Template Parameters:
Component The type of components you want to register
This function is used to register a new component in the private member _unordered_map
Template Parameters:
Component The type of components you want to get
Template Parameters:
Component The type of components you want to get
Return: The entity just created (id)
This function is used to create a new entity if it doesn't exists in the _entitiesBin, otherwise it recover it from the bin
Parameters:
idx The index of the entity whose id is desired
Parameters:
Parameters:
c The component you want to add
Template Parameters:
Component The type of component want to be added
Return: the SparseArray reference of the component
Parameters:
p Parameters of the component you want to emplace
Template Parameters:
Component The type of component you want to emplace
Params The parameters' type of the component you want to emplace
Return: the SparseArray reference of the component
This function is used to emplace a component with given parameters of this component
Parameters:
Template Parameters:
Component The type of the component you want to remove
Updated on 2022-11-13 at 17:21:37 +0100
()
template <class Component > < Component > &
()
template <class Component > < Component > &
()
template <class Component > < Component > const &
() const
()
(std::size_t idx)
( const & e)
template <typename Component > < Component >::referenceType
( const & to, Component && c)
template <typename Component ,typename... Params> < Component >::referenceType
( const & to, Params &&... p)
( const & from)
Component Manager, is able to register/get components from the unordered map
Manager, is able to create/delete and add component to an
(Feel free to check the to learn more about the subject)
EntitiesBin Manager, is saving killed entity in the bin that which can be recovered instead of creating another one
Return: The of components you just registered
Return: The of components you asked
This function is used to get all components already registered in the class following the given component template
Return: The const of components you asked
This function is used to get all components already registered in the class following the given component template as const
Return: The id of the if it exists, ecs::npos otherwise
This function is used to get the id of the following the give index
e The you want to kill
This is used to delete the given (id) For optimisation purposes, class push it in the _entitiesBin
to The in which you want to add component
This function is used to add a component into the given as parameter. In the same time, the erase function of this component is pushed into the _eraseFunctions vector, in this case we can simply delete a component without needing type of it
to The in which you want to emplace component
from The in which you want to remove component
This function is used to remove a component into an given as parameter