From d10ec8e5b1d6b5c17f09727fb70c28ea4177607d Mon Sep 17 00:00:00 2001 From: "jason@long.name" Date: Wed, 27 Feb 2013 01:30:17 +0000 Subject: [PATCH] cleanup: rename canAutoBulldoze to canAutoBulldozeZ since this method is only for when a ZONE is being placed (Z=Zone) git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@589 d9718cc8-9f43-0410-858b-315f434eb58c --- src/micropolisj/engine/MicropolisTool.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/micropolisj/engine/MicropolisTool.java b/src/micropolisj/engine/MicropolisTool.java index 8646ce9..67daa0f 100644 --- a/src/micropolisj/engine/MicropolisTool.java +++ b/src/micropolisj/engine/MicropolisTool.java @@ -142,7 +142,7 @@ public enum MicropolisTool { if (engine.autoBulldoze) { - if (canAutoBulldoze(tileValue)) + if (canAutoBulldozeZ(tileValue)) cost++; else canBuild = false; @@ -204,7 +204,7 @@ public enum MicropolisTool { if (engine.autoBulldoze) { - if (canAutoBulldoze(tileValue)) + if (canAutoBulldozeZ(tileValue)) cost++; else canBuild = false; @@ -267,7 +267,7 @@ public enum MicropolisTool { if (engine.autoBulldoze) { - if (canAutoBulldoze(tileValue)) + if (canAutoBulldozeZ(tileValue)) cost++; else canBuild = false; @@ -331,8 +331,15 @@ public enum MicropolisTool } } - static boolean canAutoBulldoze(char tileValue) + /** + * Checks whether the tile can be auto-bulldozed for + * placement of a zone. + */ + static boolean canAutoBulldozeZ(char tileValue) { + //FIXME- explain why LASTTINYEXP+2 is the upper bound? + //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) ||