Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add tag for UnderWaterBridge #6250

Merged
merged 2 commits into from
Dec 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion megamek/src/megamek/utilities/BoardsTagger.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Tags> internalTagMap;
Expand Down Expand Up @@ -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++) {
Expand Down Expand Up @@ -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++;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Underwater Bride? Whole new worlds :D

}
}
}

Expand Down Expand Up @@ -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
Expand Down
Loading