-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.hpp
66 lines (55 loc) · 1.8 KB
/
player.hpp
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
65
66
#ifndef PLAYER_HPP
#define PLAYER_HPP
#include "constants.hpp"
#include "board.hpp"
class Player {
public:
void PrintAllPlayerInfo(std::vector<Property> &deeds) {
std::cout << "-- " << name << "'s Info" << std::endl;
PrintPlayerMoney();
PrintPlayerOwnedProperties(deeds);
std::cout << "Color sets: " << std::endl;
// BR [ ][X]
}
void PrintPlayerMoney() {
std::cout << name << "'s Money: $" << money << std::endl;
}
void PrintPlayerOwnedProperties(std::vector<Property> &deeds) {
std::cout << name << "'s properties: " << std::endl;
for (int i = 0; i < NUM_PROPERTIES; i++) {
if (properties[i] == owned) {
deeds[i].PrintDeedAbbrev();
std::cout << std::endl;
}
}
std::cout << std::endl;
std::cout << "Mortgaged: " << std::endl;
for (int i = 0; i < NUM_PROPERTIES; i++) {
if (properties[i] == mortgaged) {
std::cout << "- ";
deeds[i].PrintDeedAbbrev();
std::cout << std::endl;
}
}
}
void PayPlayer(int amount) {
}
void ChargePlayer (int amount) {
}
// CONSTRUCTOR: initialize Player data
Player (std::string player_name) {
name = player_name;
money = 1500;
num_owned = 0;
// Initialize 'properties' array
for (int i = 0; i < NUM_PROPERTIES; i++) {
properties[i] = not_owned;
}
}
private:
std::string name;
int money;
int num_owned;
property_status properties[NUM_PROPERTIES];
};
#endif