forked from trolley813/OpenFool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcard.h
51 lines (45 loc) · 1 KB
/
card.h
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
47
48
49
50
51
#ifndef CARD_H
#define CARD_H
#include <QString>
enum Suit {
SUIT_SPADES = 0,
SUIT_CLUBS = 1,
SUIT_DIAMONDS = 2,
SUIT_HEARTS = 3
};
enum Rank {
RANK_JOKER = 0,
RANK_ACE = 1,
RANK_TWO = 2,
RANK_THREE = 3,
RANK_FOUR = 4,
RANK_FIVE = 5,
RANK_SIX = 6,
RANK_SEVEN = 7,
RANK_EIGHT = 8,
RANK_NINE = 9,
RANK_TEN = 10,
RANK_JACK = 11,
RANK_QUEEN = 12,
RANK_KING = 13
};
class Card
{
public:
Card(Suit suit, Rank rank);
Suit suit();
Rank rank();
void setSuit(Suit suit);
void setRank(Rank rank);
QString fileName();
friend bool operator<(const Card &c1, const Card &c2);
friend bool operator<=(const Card &c1, const Card &c2);
friend bool operator>(const Card &c1, const Card &c2);
friend bool operator>=(const Card &c1, const Card &c2);
friend bool operator==(const Card &c1, const Card &c2);
friend bool operator!=(const Card &c1, const Card &c2);
protected:
Suit _suit;
Rank _rank;
};
#endif // CARD_H