-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLevelManager.h
56 lines (47 loc) · 1.18 KB
/
LevelManager.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
52
53
54
55
56
#pragma once
#include "GameObject.h"
#include <vector>
#include <string>
#include "GameObjectSharer.h"
using namespace std;
class LevelManager : public GameObjectSharer {
private:
vector<GameObject> m_GameObjects;
const std::string WORLD_FOLDER = "world";
const std::string SLASH = "/";
void runStartPhase();
void activateAllGameObjects();
public:
vector<GameObject>& getGameObjects();
void loadGameObjectsForPlayMode(string screenToLoad);
/****************************************************
*****************************************************
From GameObjectSharer interface
*****************************************************
*****************************************************/
vector<GameObject>& GameObjectSharer::getGameObjectsWithGOS()
{
return m_GameObjects;
}
GameObject& GameObjectSharer::findFirstObjectWithTag(string tag)
{
auto it = m_GameObjects.begin();
auto end = m_GameObjects.end();
for (it;
it != end;
++it)
{
if ((*it).getTag() == tag)
{
return (*it);
}
}
#ifdef debuggingErrors
cout <<
"LevelManager.h findFirstGameObjectWithTag() "
<< "- TAG NOT FOUND ERROR!"
<< endl;
#endif
return m_GameObjects[0];
}
};