]> git.localhorst.tv Git - blank.git/blob - src/ui/DirectInput.hpp
store players in world save
[blank.git] / src / ui / DirectInput.hpp
1 #ifndef BLANK_UI_DIRECTINPUT_HPP_
2 #define BLANK_UI_DIRECTINPUT_HPP_
3
4 #include "PlayerController.hpp"
5
6 #include "../app/IntervalTimer.hpp"
7
8
9 namespace blank {
10
11 class Player;
12 class World;
13 struct WorldManipulator;
14
15 class DirectInput
16 : public PlayerController {
17
18 public:
19         DirectInput(World &, Player &, WorldManipulator &);
20
21         void Update(int dt);
22
23         void StartPrimaryAction() override;
24         void StopPrimaryAction() override;
25         void StartSecondaryAction() override;
26         void StopSecondaryAction() override;
27         void StartTertiaryAction() override;
28         void StopTertiaryAction() override;
29
30 private:
31         void PickBlock();
32         void PlaceBlock();
33         void RemoveBlock();
34
35 private:
36         WorldManipulator &manip;
37
38         IntervalTimer place_timer;
39         IntervalTimer remove_timer;
40
41 };
42
43 }
44
45 #endif