Snake.hpp 435 B

12345678910111213141516171819202122232425262728
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. #ifndef _SNAKE_SNAKE_HPP_
  3. #define _SNAKE_SNAKE_HPP_
  4. #include <list>
  5. #include <Snake/Position.hpp>
  6. #include <Snake/Direction.hpp>
  7. class Snake
  8. {
  9. public:
  10. Snake(); //stub constructor. Maybe final solution?
  11. Direction direction;
  12. std::list<Position> body;
  13. Position getNextPosition() const;
  14. bool isPartOf(const Position& position) const;
  15. void move();
  16. void grow();
  17. };
  18. #endif