-
Notifications
You must be signed in to change notification settings - Fork 4
/
Deal.h
62 lines (39 loc) · 889 Bytes
/
Deal.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
#ifndef DEAL_H_INCLUDED
#define DEAL_H_INCLUDED
#include "Contract.h"
#include "Player.h"
#include "Memento.h"
#include <iostream>
#include <algorithm>
#include "misc.h"
class Player;
class Memento;
using namespace std;
enum class State {
Dealing, Bidding, Playing, Completed
};
class Deal {
private:
Contract *_contract;
Trick *_currentTrick;
array<Player *, 4> _players;
int _dealer;
int _contractor;
int _round;
int _first_player;
State _state;
void dealing();
void bidding();
void playing();
void scoring();
int scoreIfWon(int nbrOfOddTricks);
int scoreIfLost(int nbrOfOddTricks);
public:
Trick *getCurrentTrick();
Contract *getContract();
Deal(array<Player *, 4> players, int dealer);
void play();
Memento *makeMemento();
void reset(Memento *mem);
};
#endif // DEAL_H_INCLUDED