-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpace.cpp
More file actions
126 lines (99 loc) · 2.2 KB
/
Space.cpp
File metadata and controls
126 lines (99 loc) · 2.2 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#include "Space.h"
Space::Space(std::string name1, std::string name2, std::string spaceType, int propertyCost, int freeParking,
bool occupied, int owned, bool mortgaged, int houses, int rent, int tax,
std::string actionText1, std::string actionText2)
{
this->name[0] = name1;
this->name[1] = name2;
this->spaceType = spaceType;
this->propertyCost = propertyCost;
this->freeParking = freeParking;
this->occupied = occupied;
this->owned = owned;
this->mortgaged = mortgaged;
this->houses = houses;
this->rent = rent;
this->tax = tax;
this->actionText[0] = actionText1;
this->actionText[0] = actionText2;
}
Space::~Space()
{
}
//functions to set values
void Space::setName(std::string inputName, std::string inputName2) {
name[0] = inputName;
name[1] = inputName2;
houses = 0;
}
void Space::setActionText(std::string inputText, std::string inputText2) {
actionText[0] = inputText;
actionText[1] = inputText2;
houses = 0;
}
void Space::setType(std::string inputType) {
spaceType = inputType;
}
void Space::setPropertyCost(int inputCost) {
propertyCost = inputCost;
}
void Space::setFreeParking(int inputMoney) {
freeParking = inputMoney;
}
void Space::setOccupied(int inputOccupied) {
occupied = inputOccupied;
}
void Space::setOwnership(int inputOwnership) {
owned = inputOwnership;
}
void Space::setMortgaged(bool inputMortgage) {
mortgaged = inputMortgage;
}
void Space::setRent(int inputRent) {
rent = inputRent;
}
void Space::setTax(int inputTax) {
tax = inputTax;
}
//functions to get values
std::string Space::getName(int nameIndex) {
return name[nameIndex];
}
std::string Space::getActionText(int textIndex) {
return actionText[textIndex];
}
int Space::getPropertyCost() {
return propertyCost;
}
int Space::getFreeParking() {
return freeParking;
}
bool Space::getMortgaged() {
return mortgaged;
}
int Space::getRent() {
return rent;
}
int Space::getTax() {
return tax;
}
std::string Space::getType() {
return spaceType;
}
int Space::getOwnership() {
return owned;
}
int Space::getHouses() {
return houses;
}
void Space::setHouses(int inputHouses) {
houses = inputHouses;
}
bool Space::upgrade() {
if (houses < 5) {
rent = rent * 2;
houses++;
return true;
}
return false;
}