This repository was archived by the owner on Jan 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSquareType.java
More file actions
203 lines (190 loc) · 6.75 KB
/
SquareType.java
File metadata and controls
203 lines (190 loc) · 6.75 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
public abstract class SquareType {
private String name;
private String tileType;
private int owner;
private static int properties[][] = {
/* 0 Column: Ownership
* 1 Column: Property cost
* 2 Column: Property rent (-1 if not applicable)
* 3 Column: Mortgage
* 4 Column: TileType (-1 = useless, 0 = brown, 1 = light blue, 2 = magTileenta, 3 = orange,
* 4 = red, 5 = yellow, 6 = green, 7 = blue, 8 = railroad, 9 = utility
* 5 Column: Mortgage status (-1 if not applicable)
* 6 Column: Houses (-1 if not applicable)
*/
{-1, 0, 0, 0, -1, -1, -1}, //Go0
{0, 60, 2, 30, 0, 0, 0}, //Mediterr1
{-1, 0, -1, 0, -1, -1, -1}, //Chance2
{0, 60, 4, 30, 0, 0, 0}, //Baltic Ave3
{-1, 0, -200, 0, -1, -1, -1}, //Tax4
{0, 200, 50, 100, 8, 0, 0}, //Reading Railroad5
{0, 100, 6, 50, 1, 0, 0}, //OrientalAvenue6
{-1, 0, -1, 0, -1, -1, -1}, //Chance7
{0, 100, 6, 50, 1, 0, 0}, //VermontAvenue8
{0, 120, 8, 60, 1, 0, 0}, //ConnecticutAvenue9
{-1, 0, 0, 0, -1, -1, 0}, //Jail10
{0, 140, 10, 70, 2, 0, 0}, //St.CharlesPlace11
{0, 150, 4, 75, 9, 0, 0}, //ElectricCompany12
{0, 140, 10, 70, 2, 0, 0}, //StatesAvenue13
{0, 160, 12, 80, 2, 0, 0}, //VirginiaAvenue14
{0, 200, 50, 100, 8, 0, 0}, //PennsylvaniaRailroad15
{0, 180, 14, 90, 3, 0, 0}, //St.JamesPlace16
{-1, 0, -1, 0, -1, -1, -1}, //Chance17
{0, 180, 14, 90, 3, 0, 0}, //TennesseeAvenue18
{0, 200, 16, 100, 3, 0, 0}, //NewYorkAvenue19
{-1, 0, 500, 0, -1, -1, -1}, //FreeParking20
{0, 220, 18, 110, 4, 0, 0}, //KentuckyAvenue21
{-1, 0, -1, 0, -1, -1, -1}, //Chance22
{0, 220, 18, 110, 4, 0, 0}, //IndianaAvenue23
{0, 240, 20, 120, 4, 0, 0}, //IllinoisAvenue24
{0, 200, 50, 100, 8, 0, 0}, //B&ORailRoad25
{0, 260, 22, 130, 5, 0, 0}, //AtlanticAvenue26
{0, 260, 22, 130, 5, 0, 0}, //VentnorAvenue27
{0, 150, 4, 75, 9, 0, 0}, //WaterWorks28
{0, 280, 24, 140, 5, 0, 0}, //MarvinGardens29
{-1, 0, -50, 0, -1, -1, -1}, //GotoJail30
{0, 300, 26, 150, 6, 0, 0}, //PacificAvenue31
{0, 300, 26, 150, 6, 0, 0}, //NorthCarolinaAvenue32
{-1, 0, -1, 0, -1, -1, -1}, //Chance33
{0, 320, 28, 160, 6, 0, 0}, //PennsylvaniaAvenue34
{0, 200, 50, 100, 8, 0, 0}, //ShortLineRailroad35
{-1, 0, -1, 0, -1, -1, -1}, //Chance36
{0, 350, 35, 175, 7, 0, 0}, //ParkPlace37
{-1, 0, -75, 0, -1, -1, -1}, //LuxuryTax38
{0, 400, 50, 200, 7, 0, 0} //Boardwalk39
};
private static String tileNames[] = {
"Go [0]",
"Mediterranean Avenue [1]",
"Chance [2]",
"Baltic Avenue [3]",
"Income Tax [4]",
"Reading Railroad [5]",
"Oriental Avenue [6]",
"Chance [7]",
"Vermont Avenue [8]",
"Connecticut Avenue [9]",
"Jail [10]",
"St. Charles Place [11]",
"Electric Company [12]",
"States Avenue [13]",
"Virginia Avenue [14]",
"Pennsylvania Railroad [15]",
"St. James Place [16]",
"Chance [17]",
"Tennessee Avenue [18]",
"New York Avenue [19]",
"Free Parking [20]",
"Kentucky Avenue [21]",
"Chance [22]",
"Indiana Avenue [23]",
"Illinois Avenue [24]",
"B & O RailRoad [25]",
"Atlantic Avenue [26]",
"Ventnor Avenue [27]",
"Water Works [28]",
"Marvin Gardens [29]",
"Go to Jail [30]",
"Pacific Avenue [31]",
"North Carolina Avenue [32]",
"Chance [33]",
"Pennsylvania Avenue [34]",
"Short Line Railroad [35]",
"Chance [36]",
"Park Place [37]",
"Luxury Tax [38]",
"Boardwalk [39]"
};
private static int housePrices[][] = {
//6
{-1, -1, -1, -1, -1, -1}, //Go0
{0, 10, 30, 90, 160, 250}, //Mediterr1
{-1, -1, -1, -1, -1, -1}, //Chance2
{0, 20, 60, 180, 320, 450}, //Baltic Ave3
{-1, 0, -200, 0, -1, -1, -1}, //Tax4
{0, 200, 50, 100, 8, 0, 0}, //Reading Railroad5
{0, 30, 90, 270, 400, 550}, //OrientalAvenue6
{-1, -1, -1, -1, -1, -1, -1}, //Chance7
{0, 30, 90, 270, 400, 550}, //VermontAvenue8
{0, 40, 100, 300, 450, 600}, //ConnecticutAvenue9
{-1, 0, 0, 0, -1, -1, 0}, //Jail10
{0, 50, 150, 450, 625, 750}, //St.CharlesPlace11
{0, 150, 4, 75, 9, 0, 0}, //ElectricCompany12
{0, 50, 150, 450, 625, 750}, //StatesAvenue13
{0, 60, 180, 500, 700, 900}, //VirginiaAvenue14
{0, 200, 50, 100, 8, 0, 0}, //PennsylvaniaRailroad15
{0, 70, 200, 550, 750, 950}, //St.JamesPlace16
{-1, -1, -1, 0, -1, -1, -1}, //Chance17
{0, 70, 200, 550, 750, 950}, //TennesseeAvenue18
{0, 80, 220, 600, 800, 1000}, //NewYorkAvenue19
{-1, 0, 500, 0, -1, -1, -1}, //FreeParking20
{0, 90, 250, 700, 875, 1050}, //KentuckyAvenue21
{-1, 0, -1, 0, -1, -1, -1}, //Chance22
{0, 90, 250, 700, 875, 1000}, //IndianaAvenue23
{0, 100, 300, 750, 925, 1100}, //IllinoisAvenue24
{0, 200, 50, 100, 8, 0, 0}, //B&ORailRoad25
{0, 110, 330, 800, 975, 1150}, //AtlanticAvenue26
{0, 110, 330, 800, 975, 1150}, //VentnorAvenue27
{0, 150, 4, 75, 9, 0, 0}, //WaterWorks28
{0, 120, 360, 850, 1025, 1200}, //MarvinGardens29
{-1, 0, -50, 0, -1, -1, -1}, //GotoJail30
{0, 130, 390, 900, 1100, 1275}, //PacificAvenue31
{0, 130, 390, 900, 1100, 1275}, //NorthCarolinaAvenue32
{-1, 0, -1, 0, -1, -1, -1}, //Chance33
{0, 150, 450, 1000, 1200, 1400}, //PennsylvaniaAvenue34
{0, 200, 50, 100, 8, 0, 0}, //ShortLineRailroad35
{-1, 0, -1, 0, -1, -1, -1}, //Chance36
{0, 175, 500, 1100, 1300, 1500}, //ParkPlace37
{-1, 0, -75, 0, -1, -1, -1}, //LuxuryTax38
{0, 200, 600, 1400, 1700, 2000} //Boardwalk39
};
public static String getName(int tileNum) {
return tileNames[tileNum];
}
public void setName(String name) {
this.name = name;
}
public int getTileType(int tileNum) {
return properties[tileNum][4];
}
public void setTileType(String tileType) {
this.tileType = tileType;
}
public static int getOwner(int tileNum) {
return properties[tileNum][0];
}
public static void setOwner(int owner, int tileNum) {
properties[tileNum][0] = owner;
}
public static int[][] syncTiles() {
return properties;
}
public static String[] syncNames() {
return tileNames;
}
public static int getNumOfHouses(int tileNum) {
properties = syncTiles();
tileNames = syncNames();
return properties[tileNum][6];
}
public static boolean sellHouses(int tileNum) {
if (properties[tileNum][6] < 1) {
return false;
}
properties[tileNum][6]--;
return true;
}
public static void addHouse(int tileNum) {
properties[tileNum][6]++;
}
public static void doubleRentPrice(int tileNum1, int tileNum2, int tileNum3) {
}
public static void doubleRentPrice(int tileNum1, int tileNum2) {
}
public static void setRentPrice(int tileNum, int houseAmnt) {
properties[tileNum][2] = housePrices[tileNum][houseAmnt];
}
public static void resetRentPrice(int tileNum) {
properties[tileNum][2] /= 2;
}
}