Button.h 425 B

123456789101112131415161718192021222324252627
  1. #ifndef BUTTON_H
  2. #define BUTTON_H
  3. class Button final {
  4. friend class Buttons;
  5. int key;
  6. int downTime;
  7. int keyboardUp;
  8. int keyboardDown;
  9. bool controllerDown;
  10. bool released;
  11. const char* name;
  12. public:
  13. Button(int key, const char* name);
  14. bool isDown() const;
  15. int getDownTime() const;
  16. bool wasReleased() const;
  17. const char* getName() const;
  18. private:
  19. void tick();
  20. };
  21. #endif