From 7d2b2fdda53a3e732f4d1cbd60a7e26f4809884f Mon Sep 17 00:00:00 2001 From: "jason@long.name" Date: Wed, 8 May 2013 02:11:35 +0000 Subject: [PATCH] cleanup: move autobulldoze-testing functions to TileConstants git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@619 d9718cc8-9f43-0410-858b-315f434eb58c --- src/micropolisj/engine/MicropolisTool.java | 34 ---------------------- src/micropolisj/engine/TileConstants.java | 34 ++++++++++++++++++++++ 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/micropolisj/engine/MicropolisTool.java b/src/micropolisj/engine/MicropolisTool.java index abb7153..d43473b 100644 --- a/src/micropolisj/engine/MicropolisTool.java +++ b/src/micropolisj/engine/MicropolisTool.java @@ -331,40 +331,6 @@ public enum MicropolisTool } } - /** - * Checks whether the tile can be auto-bulldozed for - * placement of road, rail, or wire. - */ - static boolean canAutoBulldozeRRW(int tileValue) - { - // can we autobulldoze this tile? - return ( - (tileValue >= FIRSTRIVEDGE && tileValue <= LASTRUBBLE) || - (tileValue >= TINYEXP && tileValue <= LASTTINYEXP) - ); - } - - /** - * Checks whether the tile can be auto-bulldozed for - * placement of a zone. - */ - static boolean canAutoBulldozeZ(char tileValue) - { - //FIXME- what is significance of POWERBASE+2 and POWERBASE+12 ? - - // can we autobulldoze this tile? - if ((tileValue >= FIRSTRIVEDGE && tileValue <= LASTRUBBLE) || - (tileValue >= POWERBASE + 2 && tileValue <= POWERBASE + 12) || - (tileValue >= TINYEXP && tileValue <= LASTTINYEXP)) - { - return true; - } - else - { - return false; - } - } - void fixBorder(Micropolis engine, int left, int top, int right, int bottom) { for (int x = left; x <= right; x++) diff --git a/src/micropolisj/engine/TileConstants.java b/src/micropolisj/engine/TileConstants.java index ff7f39c..c72c74a 100644 --- a/src/micropolisj/engine/TileConstants.java +++ b/src/micropolisj/engine/TileConstants.java @@ -233,6 +233,40 @@ public class TileConstants FOOTBALLGAME1, VBRDG0, URANIUM_FUEL, LAST_TILE }; + /** + * Checks whether the tile can be auto-bulldozed for + * placement of road, rail, or wire. + */ + public static boolean canAutoBulldozeRRW(int tileValue) + { + // can we autobulldoze this tile? + return ( + (tileValue >= FIRSTRIVEDGE && tileValue <= LASTRUBBLE) || + (tileValue >= TINYEXP && tileValue <= LASTTINYEXP) + ); + } + + /** + * Checks whether the tile can be auto-bulldozed for + * placement of a zone. + */ + public static boolean canAutoBulldozeZ(char tileValue) + { + //FIXME- what is significance of POWERBASE+2 and POWERBASE+12 ? + + // can we autobulldoze this tile? + if ((tileValue >= FIRSTRIVEDGE && tileValue <= LASTRUBBLE) || + (tileValue >= POWERBASE + 2 && tileValue <= POWERBASE + 12) || + (tileValue >= TINYEXP && tileValue <= LASTTINYEXP)) + { + return true; + } + else + { + return false; + } + } + //used by queryZoneStatus public static int getBuildingId(int tile) {