TileConstants: make isIndestructible()

continuing the trend of moving tile number logic to centralized location

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@798 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-08-24 20:54:23 +00:00
parent 8635eb2d4e
commit aa40fc8760
2 changed files with 8 additions and 5 deletions

View file

@ -746,13 +746,10 @@ class MapScanner
if (isAnimated(thCh))
continue;
thCh &= LOMASK;
if (thCh < RUBBLE || thCh >= ROADBASE)
if (!isIndestructible(thCh))
{ //not rubble, radiactive, on fire or flooded
city.setTile(xx,yy,(char)
(zoneBase)
);
city.setTile(xx,yy,(char) zoneBase);
}
}
}

View file

@ -336,6 +336,12 @@ public class TileConstants
return (tmp >= FIREBASE && tmp < ROADBASE);
}
public static boolean isIndestructible(int tile)
{
int tmp = tile & LOMASK;
return tmp >= RUBBLE && tmp < ROADBASE;
}
public static boolean isRadioactive(int tile)
{
int tmp = tile & LOMASK;