R-TYPE
Public Member Functions | List of all members
Manager Class Reference

#include <Manager.hpp>

Public Member Functions

 Manager ()
 
 ~Manager ()=default
 
ECS::Entity createEntity (ECS::EntityType type)
 
void destroyEntity (ECS::Entity entity)
 
std::deque< ECS::Entity > & getEntities ()
 
std::deque< ECS::EntitygetEntityByType (ECS::EntityType type)
 
ECS::Entity getEntityById (std::size_t id)
 
void addComponent (ECS::Entity e, ECS::ComponentType c, std::shared_ptr< ECS::IComp > comp)
 
std::shared_ptr< ECS::ICompgetComponent (ECS::Entity e, ECS::ComponentType c)
 
std::map< ECS::ComponentType, std::shared_ptr< ECS::IComp > > & getComponentList (ECS::Entity entity)
 
std::deque< ECS::Entity > & getEntityList (ECS::ComponentType type)
 
template<typename System >
System & addSystem ()
 
template<class System >
System & getSystem ()
 

Constructor & Destructor Documentation

◆ Manager()

Manager::Manager ( )

The constructor for the Manager class creates a new EntityManager, ComponentManager, and SystemManager

◆ ~Manager()

Manager::~Manager ( )
default

Member Function Documentation

◆ addComponent()

void Manager::addComponent ( ECS::Entity  e,
ECS::ComponentType  c,
std::shared_ptr< ECS::IComp comp 
)

Add a component to an entity.

Parameters
eThe entity to add the component to
cThe component type to add to the entity.

◆ addSystem()

template<typename System >
System& Manager::addSystem ( )
inline

◆ createEntity()

ECS::Entity Manager::createEntity ( ECS::EntityType  type)

It creates an entity and returns it

Parameters
typeThe type of entity you want to create.
Returns
An entity.

◆ destroyEntity()

void Manager::destroyEntity ( ECS::Entity  entity)

This function destroys an entity.

Parameters
entityThe entity to destroy.

◆ getComponent()

std::shared_ptr< ECS::IComp > Manager::getComponent ( ECS::Entity  e,
ECS::ComponentType  c 
)

Get a component from the component manager.

◆ getComponentList()

std::map< ECS::ComponentType, std::shared_ptr< ECS::IComp > > & Manager::getComponentList ( ECS::Entity  entity)

It returns a map of all the components of a given entity.

◆ getEntities()

std::deque< ECS::Entity > & Manager::getEntities ( )

It returns a reference to the deque of entities

Returns
A deque of entities.

◆ getEntityById()

ECS::Entity Manager::getEntityById ( std::size_t  id)

It returns a reference to a deque of entities that have the given id

Returns
A deque of entities with the given id.

◆ getEntityByType()

std::deque< ECS::Entity > Manager::getEntityByType ( ECS::EntityType  type)

It returns a reference to a deque of entities that have the specified type

Returns
A deque of entities.

◆ getEntityList()

std::deque< ECS::Entity > & Manager::getEntityList ( ECS::ComponentType  type)

Get a list of entities that have a specific component.

◆ getSystem()

template<class System >
System& Manager::getSystem ( )
inline

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