Button.h 338 B

123456789101112131415161718192021
  1. #ifndef BUTTON_H
  2. #define BUTTON_H
  3. class Button final {
  4. bool keyDown;
  5. bool buttonDown;
  6. bool released;
  7. int downTime;
  8. public:
  9. Button();
  10. void pressKey();
  11. void releaseKey();
  12. void pressButton();
  13. void tick();
  14. bool isDown() const;
  15. int getDownTime() const;
  16. bool wasReleased() const;
  17. };
  18. #endif