forked from trolley813/OpenFool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.h
45 lines (41 loc) · 910 Bytes
/
player.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
#ifndef PLAYER_H
#define PLAYER_H
#include <QObject>
#include "table.h"
enum SortingMode : unsigned char {
ESM_UNSORTED,
ESM_ASCENDING,
ESM_DESCENDING
};
class Player : public QObject
{
Q_OBJECT
public:
explicit Player(Table *table, int index, QString name = "");
int handValue(QList<Card> hand);
int currentHandValue();
QString name() const;
void setName(const QString &name);
int index() const;
QList<Card> hand() const;
void addCard(Card c);
void startTurn();
void throwOrDone();
void tryBeat();
void clearHand();
void throwCard(Card c);
void beatWithCard(Card c);
void sortCards(SortingMode sortingMode);
signals:
void done();
void cardThrown(Card);
void cardBeaten(Card);
void take();
public slots:
protected:
QList<Card> _hand;
Table *_table;
QString _name;
int _index;
};
#endif // PLAYER_H