P-E-R-R-Y
Utilitaires, contrats et vendors du moteur, en une seule doc
Loading...
Searching...
No Matches
Entity_impl.hpp
Go to the documentation of this file.
1
10
11#ifndef ENTITY_IMPL_HPP
12#define ENTITY_IMPL_HPP
13
14//local
15#include "Entity.hpp"
16#include "Registry.hpp"
17
18//global
19#include <cstddef>
20
21namespace ecs {
22
23 class Registry;
24 using RegistryRef = Registry &;
25
26 template <typename ... Component, typename>
28 (_ecs.addComponent<Component>(*this, std::forward<Component>(c)), ...);
29 }
30
31 template <typename ... Component, typename>
33 (_ecs.removeComponent<Component>(*this), ...);
34 }
35}
36
38
39#endif // ENTITY_IMPL_HPP
Component is a template define in Registry. (not a class).
void addComponent(Component &&... c)
add a component to the entity using the registryRef method addComponent
Definition Entity_impl.hpp:27
void removeComponent()
remove a component from the entity using the registryRef method removeComponent
Definition Entity_impl.hpp:32
define the Registry class
Definition Registry.hpp:47
Entity Component System.
Registry & RegistryRef
Definition Entity.hpp:23