tiles: annotate industrial zone tiles
git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@815 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
parent
4c66df859f
commit
14944850b7
3 changed files with 88 additions and 65 deletions
|
@ -663,6 +663,19 @@ public class TileConstants
|
|||
}
|
||||
|
||||
public static boolean isIndustrialZone(int tile)
|
||||
{
|
||||
int tmp = tile & LOMASK;
|
||||
TileSpec ts = Tiles.get(tmp);
|
||||
if (ts != null) {
|
||||
if (ts.owner != null) {
|
||||
ts = ts.owner;
|
||||
}
|
||||
return ts.getBooleanAttribute("industrial-zone");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isIndustrialZoneOld(int tile)
|
||||
{
|
||||
int tmp = tile & LOMASK;
|
||||
return (tmp >= INDBASE && tmp < PORTBASE)
|
||||
|
|
|
@ -11,6 +11,7 @@ public class Tiles
|
|||
static {
|
||||
try {
|
||||
readTiles();
|
||||
checkTiles();
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
@ -100,4 +101,13 @@ public class Tiles
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static void checkTiles()
|
||||
{
|
||||
for (int i = 0; i < tiles.length; i++) {
|
||||
if (TileConstants.isIndustrialZone(i) != TileConstants.isIndustrialZoneOld(i)) {
|
||||
System.err.println("industrial zone disagreement: "+i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue