cleanup: move neutralizeRoad() to TileConstants

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@683 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-05-28 01:55:17 +00:00
parent e2fd24ff10
commit 599ea026f3
2 changed files with 13 additions and 10 deletions

View file

@ -429,4 +429,17 @@ public class TileConstants
{
return tile >= 0 && (tile & ZONEBIT) != 0;
}
/**
* Converts a road tile value with traffic to the equivalent
* road tile without traffic.
*/
public static char neutralizeRoad(int tile)
{
tile &= LOMASK;
if (tile >= ROADBASE && tile <= LASTROAD) {
tile = ((tile - ROADBASE) & 0xf) + ROADBASE;
}
return (char)tile;
}
}