getPollutionValue: move to TileConstants

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@785 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-08-11 22:43:04 +00:00
parent 6f3029fc92
commit 2eee88e529
2 changed files with 32 additions and 30 deletions

View file

@ -1028,36 +1028,6 @@ public class Micropolis
}
}
static int getPollutionValue(int tile)
{
if (tile < POWERBASE)
{
if (tile >= HTRFBASE)
return 75; //heavy traffic
if (tile >= LTRFBASE)
return 50; //light traffic
if (isFire(tile))
return 90; //active fire
if (isRadioactive(tile))
return 255; //radioactivity
return 0;
}
if (tile <= LASTIND)
return 0;
if (tile < PORTBASE)
return 50;
if (tile <= LASTPOWERPLANT)
return 100;
return 0;
}
public int getTrafficDensity(int xpos, int ypos)
{
if (testBounds(xpos, ypos)) {

View file

@ -276,6 +276,38 @@ public class TileConstants
}
}
public static int getPollutionValue(int tile)
{
tile &= LOMASK;
if (tile < POWERBASE)
{
if (tile >= HTRFBASE)
return 75; //heavy traffic
if (tile >= LTRFBASE)
return 50; //light traffic
if (isFire(tile))
return 90; //active fire
if (isRadioactive(tile))
return 255; //radioactivity
return 0;
}
if (tile <= LASTIND)
return 0;
if (tile < PORTBASE)
return 50;
if (tile <= LASTPOWERPLANT)
return 100;
return 0;
}
public static boolean isAnimated(int tile)
{
TileSpec spec = Tiles.get(tile & LOMASK);