ecs
Loading...
Searching...
No Matches
Entity_impl.hpp
Go to the documentation of this file.
1
8#ifndef ENTITY_IMPL_HPP
9#define ENTITY_IMPL_HPP
10
11//local
12#include "Entity.hpp"
13#include "Registry.hpp"
14
15//global
16#include <cstddef>
17
18namespace ecs {
19
20 class Registry;
21 using RegistryRef = Registry &;
22
23 template <typename ... Component, typename>
25 (_ecs.addComponent<Component>(*this, std::forward<Component>(c)), ...);
26 }
27
28 template <typename ... Component, typename>
30 (_ecs.removeComponent<Component>(*this), ...);
31 }
32}
33
34#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:24
void removeComponent()
remove a component from the entity using the registryRef method removeComponent
Definition Entity_impl.hpp:29
void addComponent(Entity const &to, Component &&...c)
Definition Registry_impl.hpp:50
void removeComponent(Entity const &from)
remove a component from the given entity
Definition Registry_impl.hpp:61
Entity Component System.
Registry & RegistryRef
Definition Entity.hpp:20