refactor: consolidate checkSize() into getZoneSizeFor()

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@790 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-08-12 02:23:54 +00:00
parent 4e11a80a2a
commit 33cd0d02ed
2 changed files with 16 additions and 28 deletions

View file

@ -426,15 +426,27 @@ public class TileConstants
public static int getZoneSizeFor(int tile)
{
int ch = tile & LOMASK;
if (ch < PORTBASE) {
if (ch >= RESBASE && ch < PORTBASE) {
return 3;
}
else if (ch == AIRPORT) {
else if (ch >= PORTBASE && ch <= LASTPORT) {
return 4;
}
else if (ch >= AIRPORTBASE && ch < COALBASE) {
return 6;
}
else {
else if (ch >= COALBASE && ch <= LASTPOWERPLANT) {
return 4;
}
else if (ch >= FIRESTBASE && ch < STADIUMBASE) {
return 3;
}
else if (ch >= STADIUMBASE && ch <= LASTZONE) {
return 4;
}
else {
return 0;
}
}
public static boolean isConstructed(int tile)