play.h 1.5 KB

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