]> git.localhorst.tv Git - space.git/blob - src/app/Application.h
added autopilot that sucks
[space.git] / src / app / Application.h
1 #ifndef SPACE_APPLICATION_H_
2 #define SPACE_APPLICATION_H_
3
4 #include "../ai/Autopilot.h"
5 #include "../graphics/Camera.h"
6 #include "../graphics/Moveable.h"
7 #include "../graphics/Vector.h"
8 #include "../world/Universe.h"
9
10 #include <SDL.h>
11
12
13 namespace space {
14
15 class Canvas;
16 class Ship;
17
18 class Application {
19
20 public:
21         explicit Application(Canvas &);
22
23 public:
24         void Run();
25
26 private:
27         void Loop(int delta_ms);
28
29         void HandleEvents();
30         void OnKeyDown(const SDL_KeyboardEvent &);
31         void OnKeyUp(const SDL_KeyboardEvent &);
32
33         void Update(int delta_ms);
34
35         void Render();
36
37 private:
38         Canvas &canvas;
39
40         Universe univ;
41
42         Moveable<float> focus;
43         Camera cam;
44
45         Ship *controlled;
46         Vector<int> control;
47
48         Autopilot autopilot;
49         bool apEnabled;;
50
51         Uint32 last;
52         bool running;
53         bool paused;
54
55 };
56
57 }
58
59 #endif