Architecture Arcade
Architecture Commune Arcade
Public Member Functions | List of all members
Arcade::ECS::IEntityManager Class Referenceabstract

Manage the creation of entities and their access. More...

#include <IEntityManager.hpp>

Collaboration diagram for Arcade::ECS::IEntityManager:
Collaboration graph

Public Member Functions

virtual ~IEntityManager ()=default
 
virtual IEntitycreateEntity (const std::string &id)=0
 Add an entity to the manager. More...
 
virtual const std::vector< std::shared_ptr< IEntity > > & getEntities () const =0
 Get all entities created by this manager. More...
 
virtual std::unique_ptr< std::vector< std::shared_ptr< IEntity > > > getEntitiesByComponentType (CompType comp) const =0
 Get all entities created by this manager that have at least one component of type CompType. More...
 
virtual std::unique_ptr< std::vector< std::shared_ptr< IComponent > > > getComponentsByComponentType (CompType comp) const =0
 Get all components created by this manager of type CompType. More...
 
virtual std::shared_ptr< IEntitygetEntitiesById (const std::string &id) const =0
 Get the entity created by this manager that have the requested ID. More...
 
virtual void removeEntity (const std::string &id)=0
 Remove an entity from the manager. More...
 
virtual void removeAllEntities ()=0
 Remove all entities from the manager. More...
 

Detailed Description

Manage the creation of entities and their access.

Constructor & Destructor Documentation

◆ ~IEntityManager()

virtual Arcade::ECS::IEntityManager::~IEntityManager ( )
virtualdefault

Member Function Documentation

◆ createEntity()

virtual IEntity& Arcade::ECS::IEntityManager::createEntity ( const std::string &  id)
pure virtual

Add an entity to the manager.

Parameters
idThe id of the entity to create
Returns
The entity created

◆ getComponentsByComponentType()

virtual std::unique_ptr<std::vector<std::shared_ptr<IComponent> > > Arcade::ECS::IEntityManager::getComponentsByComponentType ( CompType  comp) const
pure virtual

Get all components created by this manager of type CompType.

Parameters
compThe component type to check in each entity
Returns
The vector

◆ getEntities()

virtual const std::vector<std::shared_ptr<IEntity> >& Arcade::ECS::IEntityManager::getEntities ( ) const
pure virtual

Get all entities created by this manager.

Returns
A vector of all entities created by this manager

◆ getEntitiesByComponentType()

virtual std::unique_ptr<std::vector<std::shared_ptr<IEntity> > > Arcade::ECS::IEntityManager::getEntitiesByComponentType ( CompType  comp) const
pure virtual

Get all entities created by this manager that have at least one component of type CompType.

Parameters
compThe component type to check in each entity
Returns
The vector

◆ getEntitiesById()

virtual std::shared_ptr<IEntity> Arcade::ECS::IEntityManager::getEntitiesById ( const std::string &  id) const
pure virtual

Get the entity created by this manager that have the requested ID.

Parameters
idThe id to find
Returns
The entity

◆ removeAllEntities()

virtual void Arcade::ECS::IEntityManager::removeAllEntities ( )
pure virtual

Remove all entities from the manager.

◆ removeEntity()

virtual void Arcade::ECS::IEntityManager::removeEntity ( const std::string &  id)
pure virtual

Remove an entity from the manager.

Parameters
idThe entity id to remove

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