From 52e9d45df005d9f06121426bbbcdd6eb8ee7c6bc Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 28 Sep 2024 17:45:40 +0200 Subject: [PATCH] personal review changes --- .../common/jacksonadapters/HexAreaDeserializer.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/megamek/src/megamek/common/jacksonadapters/HexAreaDeserializer.java b/megamek/src/megamek/common/jacksonadapters/HexAreaDeserializer.java index 0a1b154b1d5..dac3358abbf 100644 --- a/megamek/src/megamek/common/jacksonadapters/HexAreaDeserializer.java +++ b/megamek/src/megamek/common/jacksonadapters/HexAreaDeserializer.java @@ -30,6 +30,10 @@ public final class HexAreaDeserializer { + // Possible future improvements: + // read board-relative sizes, like mindistance = 50%W for half board width + // read rectangle as UL corner and W/H + private static final String UNION = "union"; private static final String DIFFERENCE = "difference"; private static final String INTERSECTION = "intersection"; @@ -64,6 +68,12 @@ public final class HexAreaDeserializer { private static final String MIN_LEVEL = "minlevel"; private static final String MAX_LEVEL = "maxlevel"; + /** + * Parses a HexArea from the given YAML node. The node should be below the "area:" level. + * + * @param node The node to parse + * @return A HexArea parsed from the given node + */ public static HexArea parseShape(JsonNode node) { if (node.has(UNION)) { return parseUnion(node.get(UNION));