]> git.localhorst.tv Git - blank.git/blob - src/ui/Interface.hpp
aa040a1ede174e63a20708bdb1208fe0118e4896
[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
6 #include <SDL.h>
7 #include <glm/glm.hpp>
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 HandlePress(const SDL_KeyboardEvent &);
24         void HandleRelease(const SDL_KeyboardEvent &);
25         void Handle(const SDL_MouseMotionEvent &);
26         void HandlePress(const SDL_MouseButtonEvent &);
27         void HandleRelease(const SDL_MouseButtonEvent &);
28         void Handle(const SDL_MouseWheelEvent &);
29
30 private:
31         void UpdateMovement();
32         void InvAbs(int slot);
33         void InvRel(int delta);
34
35 private:
36         Config &config;
37         const Keymap &keymap;
38         PlayerController &player_ctrl;
39         ClientController &client_ctrl;
40
41         glm::ivec3 fwd, rev;
42         int slot;
43         int num_slots;
44
45 };
46
47 }
48
49 #endif