Game.h 1005 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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, GameStateSolve
  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. NotificationApp* notifications;
  23. int8_t column_selection;
  24. RenderBuffer *buffer;
  25. uint32_t round_start;
  26. bool can_auto_solve;
  27. bool had_change = true;
  28. public:
  29. Game();
  30. void Render(Canvas* const canvas);
  31. void Reset();
  32. void NewRound();
  33. void LongPress(InputKey key);
  34. void Press(InputKey key);
  35. void Update();
  36. void ErrorMessage();
  37. void CheckCanAutoSolve();
  38. ~Game();
  39. };