-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathComputerPlayer.h
More file actions
42 lines (27 loc) · 767 Bytes
/
ComputerPlayer.h
File metadata and controls
42 lines (27 loc) · 767 Bytes
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
#ifndef FINAL_COMPUTERPLAYER_H
#define FINAL_COMPUTERPLAYER_H
#include "Player.h"
#include "Contract.h"
class ComputerPlayer : public Player {
public:
nlohmann::json serialize() override {
json data;
data["name"] = _name;
data["hand"] = serializeHand();
data["isComputer"] = 1;
return data;
}
private:
static int n;
Card *makeDecision(std::vector<Card *> available_cards) override;
Contract *proposeContract(Contract *current_max) override;
bool hasGreater();
bool hasContractColor();
Card* theLowestAvailable(vector<Card*> available_cards);
Card* greatestOnTable();
Card* theGreatestAvailable();
vector<Card*> contractColor();
vector<Card *> available_cards;
vector<Card*> cardsOnTable;
};
#endif //FINAL_COMPUTERPLAYER_H