123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- #include "door.h"
- #include <random>
- #include <string>
- #include <utility> // pair
- #include <vector>
- typedef std::vector<int> cards;
- class Deck {
- private:
- door::ANSIColor cardback;
- vector<door::Panel *> cards;
- vector<door::Panel *> backs;
- vector<door::Panel *> mark;
- door::Panel *card_of(int c);
- std::string back_char(int level);
- door::Panel *back_of(int level);
- door::Panel *mark_of(int c);
- void init(void);
- char rank_symbol(int c);
- std::string suit_symbol(int c);
- int card_height;
- public:
- enum SUIT { HEART, DIAMOND, CLUBS, SPADE };
- Deck(int size = 3);
- Deck(door::ANSIColor backcolor, int size = 3);
- ~Deck();
- int is_rank(int c);
- int is_suit(int c);
- int is_deck(int c);
-
- bool can_play(int c1, int c2);
- door::Panel *card(int c);
-
- door::Panel *back(int level);
- door::Panel *marker(int c);
- void part(int x, int y, door::Door &d, int level, bool left);
- std::vector<int> unblocks(int c);
- const static std::array<std::pair<int, int>, 18> blocks;
- void remove_card(door::Door &door, int c, int off_x, int off_y, bool left,
- bool right);
- };
- [[deprecated("Use cardgo(int pos, int &x, int &y, int &level")]] void
- cardgo(int pos, int space, int h, int &x, int &y, int &level);
- void cardgo(int pos, int &x, int &y, int &level);
- cards card_shuffle(std::seed_seq &seed, int decks = 1);
- cards card_states(int decks = 1);
- int find_next(bool left, const cards &states, int current);
- int find_next_closest(const cards &states, int current);
|