Game Engine 2D Platformer
EntityManager.hpp
Go to the documentation of this file.
1 /*
2  * @file EntityManager.cpp
3  * @brief EnitityManager class function implementations
4  * @date 2021-03-12
5  ***********************************************/
6 #ifndef ENTITYMANAGER_HPP
7 #define ENTITYMANAGER_HPP
8 
9 #include <map>
10 #include <memory>
11 #include <vector>
12 #include <string>
13 
14 #include "Constants.hpp"
15 #include "GameEntity.hpp"
16 
17 class GameEntity; // forward
18 
19 
20 
24 {
25 public:
29  EntityManager() = default;
30  std::map<entityType, std::vector<std::shared_ptr<GameEntity>>> gameEntities;
35  void AddEntity(entityType name, std::shared_ptr<GameEntity> entity);
39  void ClearVector(entityType name);
44  std::vector<std::shared_ptr<GameEntity>> GetEntityVector(entityType name);
45 };
46 
47 #endif
entityType
Definition: Constants.hpp:54
EntityManager class that stores all entities within the game.
Definition: EntityManager.hpp:24
std::map< entityType, std::vector< std::shared_ptr< GameEntity > > > gameEntities
Definition: EntityManager.hpp:30
void ClearVector(entityType name)
Removing a particular entity from the Class.
Definition: EntityManager.cpp:22
std::vector< std::shared_ptr< GameEntity > > GetEntityVector(entityType name)
Returns the EntityVector of the class that stores the entities.
Definition: EntityManager.cpp:34
EntityManager()=default
Constructor of EntityManager.
void AddEntity(entityType name, std::shared_ptr< GameEntity > entity)
Add an entity to the Class.
Definition: EntityManager.cpp:7
Represents an interactable entity in the game that includes Main Character, NPC, Tiles ,...
Definition: GameEntity.hpp:22