Controller.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef CONTROLLER_H
  2. #define CONTROLLER_H
  3. struct Controller final {
  4. void tick();
  5. };
  6. #endif
  7. /*#ifndef KEYS_H
  8. #define KEYS_H
  9. #include <iostream>
  10. #include <array>
  11. #include "common/utils/Types.h"
  12. class Keys final {
  13. public:
  14. class Key final {
  15. public:
  16. friend class Keys;
  17. bool isDown() const;
  18. bool isReleased() const;
  19. u32 getDownTime() const;
  20. private:
  21. Key();
  22. Key(const Key&) = delete;
  23. Key(Key&&) = delete;
  24. Key& operator=(const Key&) = delete;
  25. Key& operator=(Key&&) = delete;
  26. int glfwKey;
  27. bool down;
  28. bool shouldRelease;
  29. u32 downTime;
  30. };
  31. private:
  32. Key keys[15];
  33. public:
  34. Keys();
  35. const Key& left;
  36. const Key& right;
  37. const Key& up;
  38. const Key& down;
  39. const Key& jump;
  40. const Key& sneak;
  41. const Key& camLeft;
  42. const Key& camRight;
  43. const Key& camUp;
  44. const Key& camDown;
  45. const Key& test;
  46. const Key& test2;
  47. const Key& test3;
  48. const Key& test4;
  49. const Key& test5;
  50. void release(int key);
  51. void press(int key);
  52. void tick();
  53. private:
  54. Keys(const Keys&) = delete;
  55. Keys& operator=(const Keys&) = delete;
  56. Keys(Key&&) = delete;
  57. Keys& operator=(Keys&&) = delete;
  58. };
  59. std::ostream& operator<<(std::ostream& os, const Keys::Key& k);
  60. #endif*/