cleanup: make macros isRoad and isRail to test for those tile types

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@569 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-02-23 12:53:44 +00:00
parent 89d6839101
commit 4158265409
2 changed files with 14 additions and 2 deletions

View file

@ -72,7 +72,7 @@ class MapScanner
setZonePower();
}
if (cchr9 >= ROADBASE && cchr9 < POWERBASE)
if (isRoad(cchr))
{
doRoad();
return;
@ -84,7 +84,7 @@ class MapScanner
return;
}
if (cchr9 >= RAILBASE && cchr9 < RESBASE)
if (isRail(cchr))
{
doRail();
return;

View file

@ -324,4 +324,16 @@ public class TileConstants
{
return (tile == DIRT || ((tile & BULLBIT) != 0 && (tile & BURNBIT) != 0));
}
public static boolean isRoad(int tile)
{
int tmp = tile & LOMASK;
return (tmp >= ROADBASE && tmp < POWERBASE);
}
public static boolean isRail(int tile)
{
int tmp = tile & LOMASK;
return (tmp >= RAILBASE && tmp < RESBASE);
}
}