]> git.localhorst.tv Git - blank.git/blob - src/ui/Interface.hpp
glm backwards compatibility
[blank.git] / src / ui / Interface.hpp
1 #ifndef BLANK_UI_INTERFACE_HPP_
2 #define BLANK_UI_INTERFACE_HPP_
3
4 #include "../app/Config.hpp"
5 #include "../graphics/glm.hpp"
6
7 #include <SDL.h>
8
9
10 namespace blank {
11
12 struct ClientController;
13 class Keymap;
14 struct PlayerController;
15
16 class Interface {
17
18 public:
19         Interface(Config &, const Keymap &, PlayerController &, ClientController &);
20
21         void SetInventorySlots(int num) { num_slots = num; }
22
23         void Lock();
24         void Unlock();
25
26         void HandlePress(const SDL_KeyboardEvent &);
27         void HandleRelease(const SDL_KeyboardEvent &);
28         void Handle(const SDL_MouseMotionEvent &);
29         void HandlePress(const SDL_MouseButtonEvent &);
30         void HandleRelease(const SDL_MouseButtonEvent &);
31         void Handle(const SDL_MouseWheelEvent &);
32
33 private:
34         void UpdateMovement();
35         void InvAbs(int slot);
36         void InvRel(int delta);
37
38 private:
39         Config &config;
40         const Keymap &keymap;
41         PlayerController &player_ctrl;
42         ClientController &client_ctrl;
43
44         glm::ivec3 fwd, rev;
45         int num_slots;
46
47         bool locked;
48
49 };
50
51 }
52
53 #endif