From 685ccd22d596652867b453ea9180faedf542f774 Mon Sep 17 00:00:00 2001 From: "jason@long.name" Date: Mon, 2 Dec 2013 01:44:45 +0000 Subject: [PATCH] tiles.rc: rewrite isOverWater() to use the new "over water" attribute git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@885 d9718cc8-9f43-0410-858b-315f434eb58c --- src/micropolisj/engine/TileConstants.java | 27 ++--------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/src/micropolisj/engine/TileConstants.java b/src/micropolisj/engine/TileConstants.java index 37275e7..4fb8705 100644 --- a/src/micropolisj/engine/TileConstants.java +++ b/src/micropolisj/engine/TileConstants.java @@ -300,31 +300,8 @@ public class TileConstants public static boolean isOverWater(int tile) { - // Note: BRWV will be converted to BRWH by the following - // function. - int tmp = neutralizeRoad(tile & LOMASK); - switch (tmp) - { - case HBRIDGE: - case VBRIDGE: - case BRWV: - case BRWH: - case HBRDG0: - case HBRDG1: - case HBRDG2: - case HBRDG3: - case VBRDG0: - case VBRDG1: - case VBRDG2: - case VBRDG3: - case HPOWER: - case VPOWER: - case HRAIL: - case VRAIL: - return true; - default: - return false; - } + TileSpec spec = Tiles.get(tile & LOMASK); + return spec != null && spec.overWater; } public static boolean isRubble(int cell)