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:
parent
e2fd24ff10
commit
599ea026f3
2 changed files with 13 additions and 10 deletions
|
@ -429,4 +429,17 @@ public class TileConstants
|
||||||
{
|
{
|
||||||
return tile >= 0 && (tile & ZONEBIT) != 0;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -253,16 +253,6 @@ public class ToolStroke
|
||||||
return true;
|
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)
|
protected void fixZone(int xpos, int ypos)
|
||||||
{
|
{
|
||||||
ToolEffect eff = new ToolEffect(city, xpos, ypos);
|
ToolEffect eff = new ToolEffect(city, xpos, ypos);
|
||||||
|
|
Reference in a new issue