Architecture Arcade
Architecture Commune Arcade
IEntityManager.hpp
Go to the documentation of this file.
1 /*
2 ** EPITECH PROJECT, 2023
3 ** Archi Arcade Promo 2026 Toulouse
4 ** File description:
5 ** Manager for entity that add some usefull abstraction
6 */
7 
8 #pragma once
9 
10 #include <memory>
11 #include <string>
12 #include "IEntity.hpp"
13 
14 namespace Arcade {
15  namespace ECS {
20  public:
21  virtual ~IEntityManager() = default;
29  virtual IEntity &createEntity(const std::string &id) = 0;
35  virtual const std::vector<std::shared_ptr<IEntity>> &
36  getEntities() const = 0;
45  virtual std::unique_ptr<std::vector<std::shared_ptr<IEntity>>>
46  getEntitiesByComponentType(CompType comp) const = 0;
54  virtual std::unique_ptr<std::vector<std::shared_ptr<IComponent>>>
55  getComponentsByComponentType(CompType comp) const = 0;
64  virtual std::shared_ptr<IEntity> getEntitiesById(
65  const std::string &id) const = 0;
71  virtual void removeEntity(const std::string &id) = 0;
75  virtual void removeAllEntities() = 0;
76  };
77  } // namespace ECS
78 } // namespace Arcade
Definition: ArcadeStruct.hpp:10
The IEntity interface.
Definition: IEntity.hpp:22
Manage the creation of entities and their access.
Definition: IEntityManager.hpp:19
virtual IEntity & createEntity(const std::string &id)=0
Add an entity to the manager.
virtual void removeEntity(const std::string &id)=0
Remove an entity from the manager.
virtual const std::vector< std::shared_ptr< IEntity > > & getEntities() const =0
Get all entities created by this manager.
virtual std::shared_ptr< IEntity > getEntitiesById(const std::string &id) const =0
Get the entity created by this manager that have the requested ID.
virtual void removeAllEntities()=0
Remove all entities from the manager.
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.
virtual ~IEntityManager()=default
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.