-
Notifications
You must be signed in to change notification settings - Fork 0
/
playingcard.h
52 lines (41 loc) · 941 Bytes
/
playingcard.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
52
#ifndef PLAYINGCARD_H
#define PLAYINGCARD_H
#include <QLabel>
#include <map>
enum CardType {
hearts = 1,
spades = 2,
clubs = 3,
diamonds = 4
};
using SimpleCard = std::pair<int,CardType>;
class PlayingCard
{
public:
inline static bool generated[15][5]{};
PlayingCard();
PlayingCard(QLabel* lblCard);
PlayingCard(int number, CardType cardType);
~PlayingCard();
QString getFilename();
void GenerateRandom();
void setRevealed(bool const& _revealed);
void setImage(QString const& filename);
void foldCard();
bool isRevealed();
void Remove();
void Add();
void Highlight(bool status);
void MarkTurn(bool turn);
SimpleCard getSimpleCard();
void setSimpleCard(SimpleCard sc);
int number;
CardType cardType;
private:
QLabel* lblCard;
bool revealed;
bool folded;
const int H = 142;
const int W = 117;
};
#endif // PLAYINGCARD_H