-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule.cpp
More file actions
40 lines (27 loc) · 936 Bytes
/
Module.cpp
File metadata and controls
40 lines (27 loc) · 936 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
#include "Module.h"
Module::Module(bool startEnabled) : isEnabled(startEnabled) {}
bool Module::Init() { return true; }
bool Module::Start() { return true; }
UPDATE_STATUS Module::PreUpdate() { return UPDATE_STATUS::UPDATE_CONTINUE; }
UPDATE_STATUS Module::Update() { return UPDATE_STATUS::UPDATE_CONTINUE; }
UPDATE_STATUS Module::PostUpdate() { return UPDATE_STATUS::UPDATE_CONTINUE; }
bool Module::CleanUp() { return true; }
void Module::OnCollision(Collider* c1, Collider* c2) {}
bool Module::GetInvertValue() const { return invert; };
void Module::ChangeInvert() {
if (invert == true) { invert = false; }
else if (invert == false) { invert = true; }
};
//inline bool Module::IsEnabled() const { return isEnabled; }
void Module::Enable() {
if (!isEnabled) {
isEnabled = true;
Start();
}
}
void Module::Disable() {
if (isEnabled) {
isEnabled = false;
CleanUp();
}
}