From 1876e09b48b5a4b619f866ff203c5481160b0e40 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 28 Apr 2024 13:34:45 -0400 Subject: [PATCH] method for populating lookup table --- src/engine/mbEnums.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/engine/mbEnums.java b/src/engine/mbEnums.java index 974d5454..b369a546 100644 --- a/src/engine/mbEnums.java +++ b/src/engine/mbEnums.java @@ -2539,6 +2539,7 @@ public class mbEnums { private final String[][] ranks; //Stored Rank#->Gender(M,F) private final String[] leadershipTypes; public final int templateID; + public static HashMap templateLookup = new HashMap<>(); GuildCharterType(String name, String[][] ranks, String[] leadershipTypes, EnumSet requiredClasses, EnumSet requiredRaces, EnumSet sexRequired, int templateID) { @@ -2551,6 +2552,11 @@ public class mbEnums { this.templateID = templateID; } + public static void init() { + for (GuildCharterType guildCharterType : GuildCharterType.values()) + GuildCharterType.templateLookup.put(guildCharterType.templateID, guildCharterType); + } + public static GuildCharterType getGuildTypeFromCharter(Item charter) { GuildCharterType charterType;