ecs
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ecs::Entity Class Reference

Entity class from ECS. More...

#include <Entity.hpp>

Public Member Functions

 Entity ()=delete
 Deleted default constructor, use Registry::createEntity() instead.
 
 ~Entity ()=default
 Destroy the Entity object.
 
template<typename... Component, typename = std::enable_if_t<(sizeof...(Component) >= 1)>>
void addComponent (Component &&... c)
 add a component to the entity using the registryRef method addComponent
 
template<typename... Component, typename = std::enable_if_t<(sizeof...(Component) >= 1)>>
void removeComponent ()
 remove a component from the entity using the registryRef method removeComponent
 

Public Attributes

friend Registry
 

Detailed Description

Entity class from ECS.

Examples
TestEcs.cpp.

Constructor & Destructor Documentation

◆ Entity()

ecs::Entity::Entity ( )
delete

Deleted default constructor, use Registry::createEntity() instead.

◆ ~Entity()

ecs::Entity::~Entity ( )
default

Destroy the Entity object.

Member Function Documentation

◆ addComponent()

template<typename ... Component, typename >
void ecs::Entity::addComponent ( Component &&...  c)

add a component to the entity using the registryRef method addComponent

Template Parameters
Component
Parameters
c
Examples
TestEcs.cpp.

◆ removeComponent()

template<typename ... Component, typename >
void ecs::Entity::removeComponent ( )

remove a component from the entity using the registryRef method removeComponent

Template Parameters
Component

Member Data Documentation

◆ Registry

friend ecs::Entity::Registry

The documentation for this class was generated from the following files: