-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplication.cpp
More file actions
43 lines (31 loc) · 807 Bytes
/
Application.cpp
File metadata and controls
43 lines (31 loc) · 807 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
#include "Application.h"
#include "ModuleWindow.h"
Application::Application()
{
modules[0] = win = new ModuleWindow();
}
bool Application::Init()
{
bool ret = true;
for(int i = 0; i < NUM_MODULES && ret == true; ++i)
ret = modules[i]->Init();
return ret;
}
update_status Application::Update()
{
update_status ret = UPDATE_CONTINUE;
for(int i = 0; i < NUM_MODULES && ret == UPDATE_CONTINUE; ++i)
ret = modules[i]->PreUpdate();
for(int i = 0; i < NUM_MODULES && ret == UPDATE_CONTINUE; ++i)
ret = modules[i]->Update();
for(int i = 0; i < NUM_MODULES && ret == UPDATE_CONTINUE; ++i)
ret = modules[i]->PostUpdate();
return ret;
}
bool Application::CleanUp()
{
bool ret = true;
for(int i = NUM_MODULES - 1; i >= 0 && ret == true; --i)
ret = modules[i]->CleanUp();
return ret;
}