-
Notifications
You must be signed in to change notification settings - Fork 4
/
Contract.h
41 lines (28 loc) · 814 Bytes
/
Contract.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
#ifndef CONTRACT_H_INCLUDED
#define CONTRACT_H_INCLUDED
#include "Color.h"
#include "Serializable.h"
#include <iostream>
class Contract {
private:
int _tricksAmount;
Color::Type _color;
//Maybe an option, like double, etc ...
static Contract *_pass;
Contract();
public:
static Contract *Pass();
Contract(int amountOfTricks, Color::Type color);
int getTricksAmount() const;
//void setOption(ContractOption co);
//ContractOption getContractOption();
Color::Type getColor() const;
friend std::ostream &operator<<(std::ostream &os, const Contract &c);
json serialize(){
return json({_tricksAmount, _color});
}
static Contract* unserialize(json data){
return new Contract(data[0], data[1]);
}
};
#endif // CONTRACT_H_INCLUDED