-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptManager.cpp
More file actions
44 lines (24 loc) · 770 Bytes
/
Copy pathScriptManager.cpp
File metadata and controls
44 lines (24 loc) · 770 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
#include "ScriptManager.h"
ScriptManager::ScriptManager() {
}
int ScriptManager::AddScript(Script* script) {
scripts.insert(std::pair<int, Script*>(autoinc, script));
autoinc += 1;
//cout << "Adding script " + std::to_string(scripts.size() - 1) << endl;
return scripts.size() - 1;
}
void ScriptManager::tickScript(int scriptId, float deltaTime) {
//cout << "Ticking script " + std::to_string(scriptId) << endl;
scripts[scriptId]->tickScript(deltaTime);
}
Script* ScriptManager::getScript(int scriptId) {
return scripts[scriptId];
}
void ScriptManager::Delete() {
map<int, Script*>::iterator it;
for (it = scripts.begin(); it != scripts.end(); it++)
{
it->second->Delete();
}
delete this;
}