-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathspace.cpp
102 lines (80 loc) · 1.57 KB
/
space.cpp
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
#include "space.h"
#include <iostream>
//functions to set values
void Space::setName(string inputName, string inputName2){
name[0] = inputName;
name[1] = inputName2;
houses = 0;
}
void Space::setActionText(string inputText, string inputText2){
actionText[0] = inputText;
actionText[1] = inputText2;
houses = 0;
}
void Space::setType(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
string Space::getName(int nameIndex){
return name[nameIndex];
}
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;
}
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;
} else {
return false;
}
}