VEGO-Engine  0.1
Loading...
Searching...
No Matches
Manager.h
1#pragma once
2
3#include <iostream>
4
5#include <array>
6#include <memory>
7#include <vector>
8
9#include "Constants.h"
10#include "Entity.h"
11
12class GameInternal;
23{
24public:
25 Manager(GameInternal* game) : game(game) {};
26
27 void update();
30 void refresh();
31
32 void addToGroup(Entity* mEntity, Group mGroup);
33 std::vector<Entity*>& getGroup(Group mGroup);
34
35 std::vector<Entity*> getAll();
36
37 Entity& addEntity();
38
39 GameInternal* getGame() { return this->game; };
40
41private:
42 GameInternal* game;
43 std::vector<std::unique_ptr<Entity>> entities;
44 std::array<std::vector<Entity*>, MAX_GROUPS> entitiesByGroup;
45};
Main class for any object in game, stores associations, labeling and components.
Definition Entity.h:35
Definition GameInternal.h:24
Is responsible for managing all entities.
Definition Manager.h:23
std::vector< Entity * > & getGroup(Group mGroup)
Definition Manager.cpp:40
Entity & addEntity()
Creates and returns a new, empty entity.
Definition Manager.cpp:54
void addToGroup(Entity *mEntity, Group mGroup)
Definition Manager.cpp:35
std::vector< Entity * > getAll()
Definition Manager.cpp:45
void refresh()
Definition Manager.cpp:9
void update()
Definition Manager.cpp:30