diff --git a/src/micropolisj/engine/Micropolis.java b/src/micropolisj/engine/Micropolis.java index 1eb3ded..f10e839 100644 --- a/src/micropolisj/engine/Micropolis.java +++ b/src/micropolisj/engine/Micropolis.java @@ -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)) { diff --git a/src/micropolisj/engine/TileConstants.java b/src/micropolisj/engine/TileConstants.java index 728aa5c..7023b01 100644 --- a/src/micropolisj/engine/TileConstants.java +++ b/src/micropolisj/engine/TileConstants.java @@ -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);