-
Notifications
You must be signed in to change notification settings - Fork 0
/
celldata.cpp
83 lines (64 loc) · 1.3 KB
/
celldata.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
//SIMCITY - CSCE2110.201 - Group 10
#include "celldata.h"
celldata::celldata() {
type = 'x';
population = 0;
pollution = 0;
x = -1;
y = -1;
}
celldata::celldata(char cellType, int cellPopulation, int cellPollution, int xCoord, int yCoord){
type = cellType;
population = cellPopulation;
pollution = cellPollution;
x = xCoord;
y = yCoord;
}
void celldata::setType(char cellType) {
type = cellType;
}
void celldata::setPopulation(int cellPopulation) {
population = cellPopulation;
}
void celldata::setPollution(int cellPollution) {
pollution = cellPollution;
}
char celldata::getType() {
return type;
}
int celldata::getPopulation() {
return population;
}
int celldata::getPollution() {
return pollution;
}
void celldata::incPopulation(){
population = population + 1;
}
void celldata::setTempPopulation(int tPop){
tempPopulation = tPop;
}
int celldata::getTempPopulation(){
return tempPopulation;
}
void celldata::incTempPopulation(){
tempPopulation = tempPopulation + 1;
}
void celldata::setTotalAdjPop(int tap){
totalAdjPop = tap;
}
int celldata::getTotalAdjPop(){
return totalAdjPop;
}
void celldata::setX(int xCoord){
x = xCoord;
}
void celldata::setY(int yCoord){
y = yCoord;
}
int celldata::getX(){
return x;
}
int celldata::getY(){
return y;
}