refactor: make getZoneSizeFor return CityDimension (width AND height)
git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@843 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
parent
2af5cf14a7
commit
94e9892731
3 changed files with 45 additions and 49 deletions
|
@ -396,30 +396,13 @@ public class TileConstants
|
|||
x == BRWV);
|
||||
}
|
||||
|
||||
public static int getZoneSizeFor(int tile)
|
||||
public static CityDimension getZoneSizeFor(int tile)
|
||||
{
|
||||
int ch = tile & LOMASK;
|
||||
if (ch >= RESBASE && ch < PORTBASE) {
|
||||
return 3;
|
||||
}
|
||||
else if (ch >= PORTBASE && ch <= LASTPORT) {
|
||||
return 4;
|
||||
}
|
||||
else if (ch >= AIRPORTBASE && ch < COALBASE) {
|
||||
return 6;
|
||||
}
|
||||
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;
|
||||
TileSpec spec = Tiles.get(tile & LOMASK);
|
||||
if (spec.owner != null) {
|
||||
spec = spec.owner;
|
||||
}
|
||||
return spec.getBuildingSize();
|
||||
}
|
||||
|
||||
public static boolean isConstructed(int tile)
|
||||
|
|
Reference in a new issue