play.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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::Panel> make_score_panel();
  20. std::unique_ptr<door::Panel> make_tripeaks(void);
  21. std::unique_ptr<door::Panel> make_command_panel(void);
  22. std::unique_ptr<door::Panel> make_streak_panel(void);
  23. std::unique_ptr<door::Panel> make_left_panel(void);
  24. std::unique_ptr<door::Panel> make_next_panel(void);
  25. int hand;
  26. int total_hands;
  27. int play_card;
  28. int current_streak;
  29. int best_streak;
  30. int select_card; // the card the player selects, has state=1
  31. unsigned long score;
  32. int days_played;
  33. Deck dp; // deckPanels
  34. int off_x, off_y;
  35. const int height = 3;
  36. std::chrono::_V2::system_clock::time_point play_day;
  37. door::ANSIColor deck_color;
  38. cards deck;
  39. cards state;
  40. void redraw(bool dealing);
  41. void bonus(void);
  42. int play_cards(void);
  43. public:
  44. PlayCards(door::Door &d, DBData &dbd, std::mt19937 &r);
  45. ~PlayCards();
  46. int play(void);
  47. void init_values(void);
  48. door::renderFunction statusValue(door::ANSIColor status,
  49. door::ANSIColor value);
  50. door::renderFunction commandLineRender(door::ANSIColor bracket,
  51. door::ANSIColor inner,
  52. door::ANSIColor outer);
  53. };
  54. #endif