-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLevelManager.cpp
More file actions
44 lines (36 loc) · 888 Bytes
/
Copy pathLevelManager.cpp
File metadata and controls
44 lines (36 loc) · 888 Bytes
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
#include "LevelManager.h"
#include "PlayModeObjectLoader.h"
#include <iostream>
using namespace std;
using namespace sf;
void LevelManager::loadGameObjectsForPlayMode(string screenToLoad)
{
m_GameObjects.clear();
string levelToLoad = "" + WORLD_FOLDER + SLASH + screenToLoad;
PlayModeObjectLoader pmol;
pmol.loadGameObjectsForPlayMode(levelToLoad, m_GameObjects);
runStartPhase();
}
vector<GameObject>& LevelManager::getGameObjects()
{
return m_GameObjects;
}
void LevelManager::runStartPhase()
{
auto it = m_GameObjects.begin();
auto end = m_GameObjects.end();
for (; it != end; ++it)
{
(*it).start(this);
}
activateAllGameObjects();
}
void LevelManager::activateAllGameObjects()
{
auto it = m_GameObjects.begin();
auto end = m_GameObjects.end();
for (; it != end; ++it)
{
(*it).setActive();
}
}