/
player.h
61 lines (43 loc) · 1.04 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef PLAYER_H
#define PLAYER_H
class Table;
#include "deck.h"
#include <QString>
class Player
{
public:
enum Action {
Fold,
Call,
Raise
};
Player(bool offensive = false);
virtual Action assess(Table *table);
int handStrength(Table *table);
void setDeck(Deck deck);
bool hasFolded() const { return m_hasFolded; }
int money() { return m_money; }
void takeMoney(int amount) { m_money -= amount; }
void giveMoney(int amount) { m_money += amount; }
int bet() { return m_bet; }
int lastHandStrength() { return m_lastHandStrength; }
const QString name() const { return m_name; }
void win() { m_win++; }
int wins() { return m_win; }
void tie() { m_tie++; }
int ties() { return m_tie; }
int bets;
const Deck &deck() const { return m_cards; }
protected:
Deck m_cards;
bool m_hasFolded;
int m_money;
int m_bet;
bool m_offensive;
QString m_name;
private:
int m_lastHandStrength;
int m_win;
int m_tie;
};
#endif // PLAYER_H