-
Notifications
You must be signed in to change notification settings - Fork 0
/
unitManager.h
51 lines (35 loc) · 972 Bytes
/
unitManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include "unit.h"
#include "EventListener.h"
#include <map>
enum class GraphicsLayer;
class UnitManager : public EventListener
{
public:
UnitManager();
~UnitManager();
//handling animations for units
void setUnitAnimations(const std::map<std::string, Animation*> &animations);
//getters
std::map<std::string, Animation*> &getUnitAnimations();
std::vector<Unit*> &getUnits(){ return mUnits; }
//handling Units
void addUnit(Unit *unit);
void clear();
void deleteUnit(int index);
Unit *getUnit(int index);
//game flow functions
void draw(const GraphicsLayer layer);
void resetLevel();
void update(double timeElapsed);
//event functions
virtual void handleEvent(const Event& theEvent);
//setters
void setLevelEnded(bool torf);
//cleanup functions
void cleanup();
protected:
bool mLevelEnded;
std::vector<Unit*> mUnits;
std::map<std::string, Animation*> mUnitAnimations;
};