From 8ff043b746b777bc530359b9c7849b204e44794a Mon Sep 17 00:00:00 2001 From: kuronekochomusuke Date: Sun, 8 Dec 2024 15:27:00 -0500 Subject: [PATCH 1/2] add tag for UnderWaterBridge --- megamek/src/megamek/utilities/BoardsTagger.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/megamek/src/megamek/utilities/BoardsTagger.java b/megamek/src/megamek/utilities/BoardsTagger.java index 457b37c696a..7d71818a005 100644 --- a/megamek/src/megamek/utilities/BoardsTagger.java +++ b/megamek/src/megamek/utilities/BoardsTagger.java @@ -92,7 +92,8 @@ public enum Tags { TAG_ARMOREDBUILDING("ArmoredBuilding"), TAG_IMPASSABLE("Impassable"), TAG_ELEVATOR("Elevator"), - TAG_MULTIPLETHEME("MultipleTheme"); + TAG_MULTIPLETHEME("MultipleTheme"), + TAG_UNDERWATERBRIDGE("UnderWaterBridge"); private String tagName; private static final Map internalTagMap; @@ -233,6 +234,7 @@ private static void tagBoard(File boardFile) { int impassable = 0; int elevator = 0; int multipleTheme = 0; + int underWaterBride = 0; for (int x = 0; x < board.getWidth(); x++) { for (int y = 0; y < board.getHeight(); y++) { @@ -291,6 +293,11 @@ private static void tagBoard(File boardFile) { } impassable += hex.containsTerrain(IMPASSABLE) ? 1 : 0; elevator += hex.containsTerrain(ELEVATOR) ? 1 : 0; + if (hex.containsTerrain(WATER) + && hex.containsTerrain(BRIDGE) + && (hex.terrainLevel(BRIDGE_ELEV) < hex.terrainLevel(WATER))) { + underWaterBride++; + } } } @@ -359,6 +366,7 @@ private static void tagBoard(File boardFile) { multipleTheme += snowTheme > 0 ? 1 : 0; multipleTheme += volcanic > 0 ? 1 : 0; matchingTags.put(Tags.TAG_MULTIPLETHEME, multipleTheme > 1); + matchingTags.put(Tags.TAG_UNDERWATERBRIDGE, underWaterBride > 0); // Remove (see below) any auto tags that might be present so that auto tags that // no longer apply From 039ecf98ad5e06e6138d81f1f5b3f402521fdf04 Mon Sep 17 00:00:00 2001 From: kuronekochomusuke Date: Fri, 13 Dec 2024 19:12:05 -0500 Subject: [PATCH 2/2] fix typo --- megamek/src/megamek/utilities/BoardsTagger.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/megamek/src/megamek/utilities/BoardsTagger.java b/megamek/src/megamek/utilities/BoardsTagger.java index 7d71818a005..9c7acb2ff81 100644 --- a/megamek/src/megamek/utilities/BoardsTagger.java +++ b/megamek/src/megamek/utilities/BoardsTagger.java @@ -234,7 +234,7 @@ private static void tagBoard(File boardFile) { int impassable = 0; int elevator = 0; int multipleTheme = 0; - int underWaterBride = 0; + int underWaterBridge = 0; for (int x = 0; x < board.getWidth(); x++) { for (int y = 0; y < board.getHeight(); y++) { @@ -296,7 +296,7 @@ private static void tagBoard(File boardFile) { if (hex.containsTerrain(WATER) && hex.containsTerrain(BRIDGE) && (hex.terrainLevel(BRIDGE_ELEV) < hex.terrainLevel(WATER))) { - underWaterBride++; + underWaterBridge++; } } } @@ -366,7 +366,7 @@ private static void tagBoard(File boardFile) { multipleTheme += snowTheme > 0 ? 1 : 0; multipleTheme += volcanic > 0 ? 1 : 0; matchingTags.put(Tags.TAG_MULTIPLETHEME, multipleTheme > 1); - matchingTags.put(Tags.TAG_UNDERWATERBRIDGE, underWaterBride > 0); + matchingTags.put(Tags.TAG_UNDERWATERBRIDGE, underWaterBridge > 0); // Remove (see below) any auto tags that might be present so that auto tags that // no longer apply