method for populating lookup table

This commit is contained in:
2024-04-28 13:34:45 -04:00
parent 31c83f2bb5
commit 1876e09b48
+6
View File
@@ -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<Integer, GuildCharterType> templateLookup = new HashMap<>();
GuildCharterType(String name, String[][] ranks, String[] leadershipTypes, EnumSet<ClassType> requiredClasses,
EnumSet<MonsterType> requiredRaces, EnumSet<SexType> 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;