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;
}
}

View file

@ -253,16 +253,6 @@ public class ToolStroke
return true;
}
// checks whether the tile value represents road with traffic
// and if so converts it to the equivalent road without traffic.
static char neutralizeRoad(int tile)
{
tile &= LOMASK;
if (tile >= 64 && tile <= 207)
tile = (char)( (tile & 0xf) + 64 );
return (char)tile;
}
protected void fixZone(int xpos, int ypos)
{
ToolEffect eff = new ToolEffect(city, xpos, ypos);