-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathPlayer.h
86 lines (64 loc) · 1.47 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef PLAYER_H
#define PLAYER_H
#include <QObject>
#include "Cards.h"
class Player : public QObject
{
Q_OBJECT
public:
explicit Player(QObject *parent = 0);
public:
enum Role
{
Lord,
Farmer
};
enum Type
{
Unknow,
User,
Robot
};
void CallLord(int bet);
void PlayHand(const Cards& cards);
signals:
void NotifyCallLord(Player*, int);
void NotifyPlayHand(Player*, const Cards&);
void NotifyPickCards(Player*, const Cards&);
public slots:
void OnPlayerPunch(Player* player, const Cards& cards);
public:
void SetType(Type type);
Type GetType();
void SetRole(Role role);
Role GetRole();
void SetName(const QString& name);
QString GetName();
int GetMark();
void SetMark(int mark);
void SetPrevPlayer(Player* player);
Player* GetPrevPlayer();
void SetNextPlayer(Player* player);
Player* GetNextPlayer();
void ClearCards();
void PickCards(const Cards& cards);
void PickCard(const Card& card);
virtual void StartCallLord();
virtual void StartPlayHand();
virtual void ThinkForCallLord();
virtual void ThinkForPlayHand();
Cards GetCards();
Player* GetPunchPlayer();
Cards GetPunchCards();
protected:
QString m_name;
Cards m_cards;
Role m_role;
Type m_type;
int m_mark;
Player* m_punchPlayer;
Cards m_punchCards;
Player* m_nextPlayer;
Player* m_prevPlayer;
};
#endif // PLAYER_H