-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathManager.cpp
53 lines (46 loc) · 1.16 KB
/
Manager.cpp
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
#include "Manager.h"
#include "LogManager.h"
#include "WorldManager.h"
#include "ObjectListIterator.h"
namespace df {
Manager::Manager() {
setType("Manager");
m_is_started = false;
}
Manager::~Manager() {
}
//Sets the m_is_started variable to true
int Manager::startUp() {
//LM.writeLog(3, "Manager startUp()");
m_is_started = true;
return 0;
}
//Sets the m_is_started variable to false
void Manager::shutDown() {
//LM.writeLog(3, "Manager shutDown()");
m_is_started = false;
}
//Checks if manager has been successfully started
bool Manager::isStarted() const {
return m_is_started;
}
//Sets type to the name Manager
void Manager::setType(std::string type) {
m_type = type;
}
//Return's the Manager's type
std::string Manager::getType() const {
return m_type;
}
int Manager::onEvent(const Event* p_event) const {
int count = 0;
//ObjectList all_objects = WM.getAllObjects();
ObjectListIterator* li = new ObjectListIterator(new ObjectList(WM.getAllObjects()));
while (!li->isDone()) {
li->currentObject()->eventHandler(p_event);
li->next();
count++;
}
return count;
}
}