VOX
A little voxel engine
Loading...
Searching...
No Matches
ECS Class Reference

#include <ECS_old.hpp>

Collaboration diagram for ECS:
Collaboration graph

Public Types

typedef uint64_t Entity
 

Public Member Functions

 ECS ()
 
 ~ECS ()
 
 ECS (ECS &other)=delete
 
 ECS (ECS &&other)=delete
 
ECSoperator= (ECS &other)=delete
 
ECSoperator= (ECS &&other)=delete
 
Entity createEntity ()
 
void removeEntity (Entity entity)
 
template<typename T , typename... Args>
void addComponent (Entity entity, Args &&... args)
 
template<typename T >
T * getComponent (Entity entity)
 
template<typename T >
void removeComponent (Entity entity)
 
template<typename... Components>
void forEach (void(*func)(Components &...))
 This function will call the function func for each entity that has all the components specified. More...
 

Member Typedef Documentation

◆ Entity

typedef uint64_t ECS::Entity

Constructor & Destructor Documentation

◆ ECS() [1/3]

ECS::ECS ( )
inline

◆ ~ECS()

ECS::~ECS ( )
inline

◆ ECS() [2/3]

ECS::ECS ( ECS other)
delete

◆ ECS() [3/3]

ECS::ECS ( ECS &&  other)
delete

Member Function Documentation

◆ addComponent()

template<typename T , typename... Args>
void ECS::addComponent ( Entity  entity,
Args &&...  args 
)
inline

◆ createEntity()

Entity ECS::createEntity ( )
inline

◆ forEach()

template<typename... Components>
void ECS::forEach ( void(*)(Components &...)  func)
inline

This function will call the function func for each entity that has all the components specified.

Template Parameters
ComponentsThe components that the entity must have. They are specified by the function arguments
Parameters
funcThe function to call

◆ getComponent()

template<typename T >
T * ECS::getComponent ( Entity  entity)
inline

◆ operator=() [1/2]

ECS & ECS::operator= ( ECS &&  other)
delete

◆ operator=() [2/2]

ECS & ECS::operator= ( ECS other)
delete

◆ removeComponent()

template<typename T >
void ECS::removeComponent ( Entity  entity)
inline

◆ removeEntity()

void ECS::removeEntity ( Entity  entity)
inline

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