-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMemento.h
52 lines (35 loc) · 796 Bytes
/
Memento.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 BRIDGEGAME_MEMENTO_H
#define BRIDGEGAME_MEMENTO_H
#include "Contract.h"
#include "json.hh"
#include "misc.h"
#include "Player.h"
#include <array>
#include <fstream>
using namespace std;
using json = nlohmann::json;
enum class State;
class Deal;
class Contract;
class Player;
class Memento {
private:
int round;
int first_player;
json players;
json contract;
int contractor = -1;
State state;
json teams;
void setRound(int value);
void setState(State value);
void setFirstPlayer(int value);
void setPlayers(array<Player *, 4> player_list);
void setContract(Contract *contract, int contractor);
void saveFile();
friend class Deal;
friend class Game;
public:
static Memento* loadFile(int index = -1);
};
#endif