Game.h 918 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #include <gui/canvas.h>
  3. #include <notification/notification.h>
  4. #include "utils/List.h"
  5. #include "utils/Card.h"
  6. #include "utils/RenderBuffer.h"
  7. #include "Deck.h"
  8. #include "TableauColumn.h"
  9. typedef enum {
  10. GameStateGameOver, GameStateStart, GameStatePlay, GameStateAnimate
  11. } PlayState;
  12. class Game {
  13. Deck *deck;
  14. Card *piles[4];
  15. TableauColumn tableau[7];
  16. TableauColumn hand;
  17. PlayState state = GameStateStart;
  18. uint8_t current_row;
  19. uint8_t current_column;
  20. uint8_t picked_from_row;
  21. uint8_t picked_from_column;
  22. int8_t column_selection;
  23. RenderBuffer *buffer;
  24. uint32_t round_start;
  25. bool can_auto_solve;
  26. bool had_change = true;
  27. public:
  28. Game();
  29. void Render(Canvas* const canvas);
  30. void Reset();
  31. void NewRound();
  32. void LongPress(InputKey key);
  33. void Press(InputKey key);
  34. void Update(NotificationApp *app);
  35. ~Game();
  36. };