play.h 1.8 KB

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