play.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef PLAY_H
  2. #define PLAY_H
  3. #include "db.h"
  4. #include "deck.h"
  5. #include "door.h"
  6. #include <chrono>
  7. #include <random>
  8. class PlayCards {
  9. private:
  10. door::Door &door;
  11. DBData &db;
  12. std::mt19937 &rng;
  13. std::unique_ptr<door::Panel> spaceAceTriPeaks;
  14. std::unique_ptr<door::Panel> score_panel;
  15. std::unique_ptr<door::Panel> streak_panel;
  16. std::unique_ptr<door::Panel> left_panel;
  17. std::unique_ptr<door::Panel> cmd_panel;
  18. std::unique_ptr<door::Panel> next_quit_panel;
  19. std::unique_ptr<door::Screen> calendar;
  20. std::unique_ptr<door::Panel> make_score_panel();
  21. std::unique_ptr<door::Panel> make_tripeaks(void);
  22. std::unique_ptr<door::Panel> make_command_panel(void);
  23. std::unique_ptr<door::Panel> make_streak_panel(void);
  24. std::unique_ptr<door::Panel> make_left_panel(void);
  25. std::unique_ptr<door::Panel> make_next_panel(void);
  26. std::shared_ptr<door::Panel> make_weekdays(void);
  27. std::shared_ptr<door::Panel> make_month(std::string month);
  28. std::unique_ptr<door::Screen> make_calendar(void);
  29. int press_a_key(void);
  30. int hand;
  31. int total_hands;
  32. int play_card;
  33. int current_streak;
  34. int best_streak;
  35. int select_card; // the card the player selects, has state=1
  36. unsigned long score;
  37. int days_played;
  38. Deck dp; // deckPanels
  39. int off_x, off_y;
  40. const int height = 3;
  41. std::chrono::_V2::system_clock::time_point play_day;
  42. door::ANSIColor deck_color;
  43. cards deck;
  44. cards state;
  45. void redraw(bool dealing);
  46. void bonus(void);
  47. int play_cards(void);
  48. public:
  49. PlayCards(door::Door &d, DBData &dbd, std::mt19937 &r);
  50. ~PlayCards();
  51. int play(void);
  52. void init_values(void);
  53. door::renderFunction statusValue(door::ANSIColor status,
  54. door::ANSIColor value);
  55. door::renderFunction commandLineRender(door::ANSIColor bracket,
  56. door::ANSIColor inner,
  57. door::ANSIColor outer);
  58. };
  59. #endif