Game.hpp 372 B

123456789101112131415161718192021222324252627
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. #ifndef _SNAKE_GAME_HPP_
  3. #define _SNAKE_GAME_HPP_
  4. #include <Snake/Position.hpp>
  5. #include <Snake/Direction.hpp>
  6. #include <Snake/Snake.hpp>
  7. class Game
  8. {
  9. public:
  10. Game(uint8_t size);
  11. const uint8_t size;
  12. Snake snake;
  13. Position apple;
  14. bool isInsideField(const Position& position) const;
  15. void doStep();
  16. };
  17. #endif