-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathManager.cpp
More file actions
44 lines (34 loc) · 860 Bytes
/
Manager.cpp
File metadata and controls
44 lines (34 loc) · 860 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 "Manager.h"
#include "WorldManager.h"
#include "ObjectList.h"
#include "Object.h"
namespace df {
Manager::Manager() : m_type("Manager"), m_is_started(false) {}
Manager::~Manager() {}
void Manager::setType(std::string type) {
m_type = type;
}
std::string Manager::getType() const {
return m_type;
}
int Manager::startUp() {
m_is_started = true;
return 0;
}
void Manager::shutDown() {
m_is_started = false;
}
bool Manager::isStarted() const {
return m_is_started;
}
// Send event to all Objects in the game world.
// Return count of objects that handled the event.
int Manager::onEvent(const Event *p_event) const {
int count = 0;
ObjectList all = WM.getAllObjects();
for (int i = 0; i < all.getCount(); i++) {
count += all[i]->eventHandler(p_event);
}
return count;
}
} // end namespace df