Browse Source

method for populating lookup table

combat-2
MagicBot 8 months ago
parent
commit
1876e09b48
  1. 6
      src/engine/mbEnums.java

6
src/engine/mbEnums.java

@ -2539,6 +2539,7 @@ public class mbEnums { @@ -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 { @@ -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;

Loading…
Cancel
Save