-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProperty.cpp
More file actions
153 lines (131 loc) · 3.1 KB
/
Property.cpp
File metadata and controls
153 lines (131 loc) · 3.1 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#include "Property.h"
#include "Game.h"
#include <iostream>
#include <iomanip>
using namespace std;
Property::Property()
{
propertyLocation = 0;
propertyName = "";
owner = "none";
propertyCost = 0;
buildingCost = 0;
for(int i = 0; i < 6; i++)
{
rentArr[i] = 0;
}
color = "none";
numBuildings = 0;
morgage = false;
}
void Property::setPropertyLocation(int propertyLocation_)
{
propertyLocation = propertyLocation_;
}
void Property::setPropertyName(string propertyName_)
{
propertyName = propertyName_;
}
void Property::setOwner(string username_)
{
owner = username_;
}
void Property::setPropertyCost(int propertyCost_)
{
propertyCost = propertyCost_;
}
void Property::setBuildingCost(int buildingCost_)
{
buildingCost = buildingCost_;
}
void Property::setRentAt(int i, int rent_)
{
if(!(0 <= i && 0 < 6))
{
cout << "[Error -- setRentAt] Specified index is out of bounds" << endl;
}
else
{
rentArr[i] = rent_;
}
}
void Property::setColor(string color_)
{
color = color_;
}
void Property::setNumBuildings(int numBuildings_)
{
numBuildings = numBuildings_;
}
void Property::setMorgage(bool status)
{
morgage = status;
}
// ////////////////////////////////////////////////////////////////////////////////
// ////////////////////////////////////////////////////////////////////////////////
// //Accessors Section
int Property::getRentAt(int i)
{
return rentArr[i];
}
int Property::getPropertyLocation()
{
return propertyLocation;
}
string Property::getPropertyName()
{
return propertyName;
}
string Property::getOwner()
{
return owner;
}
int Property::getPropertyCost()
{
return propertyCost;
}
int Property::getBuildingCost()
{
return buildingCost;
}
void Property::getListOfRentCP()
{
cout << setw(70) << "------------------" << "\x1B[31m" << "Rent Cost" << "\x1B[0m" << "------------------" << endl;
for(int i = 0; i < 6; i++)
{
if(i == 5)
{
cout << " (5) Building (Hotel):\x1B[92m $" << rentArr[5] << "\x1B[0m" << endl;
}
else
{
cout << "(" << i << ") Building(s):\x1B[92m $" << rentArr[i] << "\x1B[0m" << setw(5);
}
}
cout << "======================================================================================================================================================" << endl;
}
void Property::getListOfRentTransport()
{
cout << setw(70) << "------------------" << "\x1B[31m" << "Rent Cost" << "\x1B[0m" << "------------------" << endl;
for(int i = 0; i < 4; i++)
{
cout << "(" << i + 1 << ") Transports Service(s):\x1B[92m $" << rentArr[i] << "\x1B[0m" << setw(5);
}
cout << endl;
}
int Property::getRent()
{
return rentArr[numBuildings];
}
string Property::getColor()
{
return color;
}
int Property::getNumBuildings()
{
return numBuildings;
}
bool Property::getMorgage_Status()
{
return morgage;
}