You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
450 B

  1. #pragma once
  2. #include <memory>
  3. #include "../input-output/Graphics.h"
  4. #include "../components/Snake.h"
  5. #include "../components/Point.h"
  6. static constexpr int DEFEAT = -1;
  7. class Controller {
  8. private:
  9. Snake snake_;
  10. Point snack_;
  11. int input_;
  12. uint32_t score_;
  13. void printScore(uint32_t score) const;
  14. void readInput();
  15. public:
  16. Controller();
  17. int act();
  18. bool wantsToQuit() const;
  19. uint32_t getScore() const;
  20. };