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;
22class Manager
23{
24public:
25 Manager(GameInternal* game) : game(game) {};
26
27 void update(uint_fast16_t diffTime);
30 void refresh();
31
32#ifndef DOXYGEN_SHOULD_SKIP_THIS
33 void addToGroup(Entity* mEntity, Group mGroup);
34 std::vector<Entity*>& getGroup(Group mGroup);
35#endif /* DOXYGEN_SHOULD_SKIP_THIS */
36
38 std::vector<Entity*> getAll();
39
41 Entity& addEntity();
42
44 GameInternal* getGame() { return this->game; };
45
46private:
47 GameInternal* game;
48 std::vector<std::unique_ptr<Entity>> entities;
49 std::array<std::vector<Entity*>, MAX_GROUPS> entitiesByGroup;
50};
Main class for any object in game, stores associations, labeling and components.
Definition Entity.h:35
GameInternal * getGame()
Definition Manager.h:44
Entity & addEntity()
Add a new entity to the game.
Definition Manager.cpp:54
std::vector< Entity * > getAll()
Returns all entities currently loaded in the game.
Definition Manager.cpp:45
void update(uint_fast16_t diffTime)
Definition Manager.cpp:30
void refresh()
Definition Manager.cpp:9