summaryrefslogtreecommitdiffstats
path: root/card.h
blob: ac0f5c000c9429a2eca059d4a16a34dc0b29281b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef _CARD_H_
#define _CARD_H_

#include <cstdio>
#include <iostream>
#include <string>

#define ANSI_COLOR_RED     "\x1b[31m"
#define ANSI_COLOR_GREEN   "\x1b[32m"
#define ANSI_COLOR_YELLOW  "\x1b[33m"
#define ANSI_COLOR_BLUE    "\x1b[34m"
#define ANSI_COLOR_MAGENTA "\x1b[35m"
#define ANSI_COLOR_CYAN    "\x1b[36m"
#define ANSI_COLOR_RESET   "\x1b[0m"
#define PRINT_COLOR(C, S)  printf("%s%s%s", C, S, ANSI_COLOR_RESET)

using std::string;
using std::cout;
using std::endl;

enum Suit { Undef = 0, Clubs, Diamond, Hearts, Spades };

class Card
{
    private:
        /* card + suit */
        string type;
        int rank;

    public:
        Card(void);
        Card(string &);
        Card(Card *);

        int getRank(void);
        enum Suit getSuit(void);

        /* could be overloaded with cout's << operator */
        string getType(void);
        void rankCard(void);
        void specialRank(void);
        void sortCards(Card **);
};

#endif