tiles: use new residential-zone/commercial-zone annotations

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@818 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-09-01 00:27:14 +00:00
parent c86b9bc03b
commit f09ba76a23

View file

@ -652,8 +652,15 @@ public class TileConstants
public static boolean isCommercialZone(int tile) public static boolean isCommercialZone(int tile)
{ {
return (tile & LOMASK) >= COMBASE && int tmp = tile & LOMASK;
(tile & LOMASK) < INDBASE; TileSpec ts = Tiles.get(tmp);
if (ts != null) {
if (ts.owner != null) {
ts = ts.owner;
}
return ts.getBooleanAttribute("commercial-zone");
}
return false;
} }
public static boolean isHospitalOrChurch(int tile) public static boolean isHospitalOrChurch(int tile)
@ -698,7 +705,14 @@ public class TileConstants
public static boolean isResidentialZoneAny(int tile) public static boolean isResidentialZoneAny(int tile)
{ {
int tmp = tile & LOMASK; int tmp = tile & LOMASK;
return (tile >= RESBASE && tile < COMBASE); TileSpec ts = Tiles.get(tmp);
if (ts != null) {
if (ts.owner != null) {
ts = ts.owner;
}
return ts.getBooleanAttribute("residential-zone");
}
return false;
} }
public static boolean isSpecialZone(int tile) public static boolean isSpecialZone(int tile)