-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.h
64 lines (57 loc) · 1.4 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
#ifndef PLAYER_H
#define PLAYER_H
#include <string>
#include <map>
#include <vector>
#include "follower.h"
#include "followertype.h"
#include "occupationmapper.h"
using namespace std;
enum PlayerColor { red, blue, green, yellow, black, grey };
struct colorMap : public map<string, PlayerColor> {
colorMap() {
this->operator[]("red") = red;
this->operator[]("blue") = blue;
this->operator[]("green") = green;
this->operator[]("yellow") = yellow;
this->operator[]("black") = black;
this->operator[]("grey") = grey;
};
};
struct htmlColorMap : public map<PlayerColor, string> {
htmlColorMap() {
this->operator[](red) = "#ff0000";
this->operator[](blue) = "#0000ff";
this->operator[](green) = "#008000";
this->operator[](yellow) = "#daa520";
this->operator[](black) = "#000000";
this->operator[](grey) = "#808080";
};
};
class Follower;
class Player {
private:
int points;
int number;
int barrels;
int barley;
int spools;
PlayerColor color;
vector<Follower*> followers;
public:
Player(int num, string col);
~Player();
void addPoints(int p);
void addMerchandise(int b, int g, int s);
int getWine();
int getGrain();
int getCloth();
int getPoints();
int getPlayerNumber();
PlayerColor getColor();
void addFollower(FollowerType t, OccupationMapper *om, int amount);
Follower* getFollower(FollowerType t);
vector<Follower*> getAllFollowers();
bool hasPlayableFollowers();
};
#endif