Advertisement
Zenn_

ECS.h

Dec 18th, 2018
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. #pragma once
  2. #include <string>
  3. #include <vector>
  4. #include "System.h"
  5. #include "Component.h"
  6.  
  7. namespace ________ {
  8.     //forwarding
  9.     struct GameData;
  10.     class ECS {
  11.     public:
  12.         ECS(GameData* gameData = nullptr);
  13.  
  14.         /*todo*/
  15.         class EntityFactory;
  16.  
  17.         /*add new entity to entity string list, return new entityID*/
  18.         std::string createEntity();
  19.         /*adds new system to system vector*/
  20.         void addSystem(SystemInterface* sys);
  21.  
  22.         /*this will only call the init function of systems
  23.         which have not been initialized yet*/
  24.         void initializeSystems();
  25.  
  26.         void updateSystems();
  27.  
  28.         void drawSystems();
  29.     private:
  30.         GameData* _data;
  31.  
  32.         std::string createEntityName();
  33.  
  34.         std::vector<std::string> entities;
  35.  
  36.         /*add the systems to this vector to update them every draw/update*/
  37.         std::vector<SystemInterface*> systems;
  38.  
  39.         int entityAmount;
  40.     };
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement