-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommercial.cpp
More file actions
55 lines (48 loc) · 1.25 KB
/
Copy pathcommercial.cpp
File metadata and controls
55 lines (48 loc) · 1.25 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
// Author: Nathan Jodoin
// CSCE2110 - SimCity
// Recitation Section 213 - Group 6
// Commercial zone Class Def. Inherits from populated << zone
#include "definitions.hpp"
class commercial : public populated
{
private:
std::list<residential*> residentialAdj;
std::list<industrial*> industrialAdj;
public:
//constructors
commercial()
{
this->population = 0;
}
//primary working constructor
commercial(int x, int y)
{
setLocation(x, y);
this->population = 0;
}
// returns the corresponding ASCII character for the zone type
char getType()
{
return 'C';
}
//returns a list of residential Adjacencies in order of distance
std::list<residential*> getResidentialAdj()
{
return this->residentialAdj;
}
// set the residential adjacencies
void setResidentialAdj(std::list<residential*> residentialAdj)
{
this->residentialAdj = residentialAdj;
}
//returns a list of industrial zone adjacencies
std::list<industrial*> getIndustrialAdj()
{
return this->industrialAdj;
}
//set the industrial adjacency list
void setIndustrialAdj(std::list<industrial*> industrialAdj)
{
this->industrialAdj = industrialAdj;
}
};