play.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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::unique_ptr<door::Panel> spaceAceTriPeaks;
  13. std::unique_ptr<door::Panel> score_panel;
  14. std::unique_ptr<door::Panel> streak_panel;
  15. std::unique_ptr<door::Panel> left_panel;
  16. std::unique_ptr<door::Panel> cmd_panel;
  17. std::unique_ptr<door::Panel> next_quit_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. std::unique_ptr<door::Panel> make_next_panel(void);
  24. int hand;
  25. int total_hands;
  26. int play_card;
  27. int current_streak;
  28. int best_streak;
  29. int select_card; // the card the player selects, has state=1
  30. unsigned long score;
  31. Deck dp; // deckPanels
  32. int off_x, off_y;
  33. const int height = 3;
  34. std::chrono::_V2::system_clock::time_point play_day;
  35. door::ANSIColor deck_color;
  36. cards deck;
  37. cards state;
  38. void redraw(bool dealing);
  39. void bonus(void);
  40. public:
  41. PlayCards(door::Door &d, DBData &dbd);
  42. ~PlayCards();
  43. int play_cards(void);
  44. void init_values(void);
  45. door::renderFunction statusValue(door::ANSIColor status,
  46. door::ANSIColor value);
  47. door::renderFunction commandLineRender(door::ANSIColor bracket,
  48. door::ANSIColor inner,
  49. door::ANSIColor outer);
  50. };
  51. #endif