Realms refactored to pull map color from database not hardcoded enum.

This commit is contained in:
2023-02-08 09:09:54 -05:00
parent abd8697d56
commit 5cfb451041
6 changed files with 48 additions and 136 deletions
-71
View File
@@ -441,77 +441,6 @@ public class Enum {
CAPTURE;
}
public enum RealmType {
SEAFLOOR(0, 0x000000),
JOTUNHEIM(7, 0x006cff),
BOGLANDS(19, 0x00b4ff),
ESTRAGOTH(3, 0x00ff90),
RENNONVALE(14, 0X00ffea),
VOLGAARD(28, 0x1e00ff),
VOSTRAGOTH(29, 0x245fae),
NARROWS(21, 0x2f20a0),
FENMARCH(5, 0x3fb5ab),
MAELSTROM(11, 0x503e3e),
FARRICH(4, 0x52cd98),
TYRRANTHMINOR(25, 0x606060),
GREYSWATHE(6, 0x6c419d),
SUNSANVIL(17, 0x7800ff),
THERRONMARCH(24, 0x7bcdef),
DYVRENGISLE(1, 0x826b9c),
KINGSLUND(10, 0x871a94),
OUTERISLES(22, 0xa01313),
KAELENSFJORD(8, 0xa0c04a),
VARMADAI(26, 0xa16d1b),
WESTERMOORE(30, 0xaa3374),
OBLIVION(12, 0xababab),
SUDRAGOTH(16, 0xbaff00),
SKAARTHOL(15, 0xcfc57f),
KHALURAM(9, 0xe400ff),
VARSHADDUR(27, 0xf2845d),
FORBIDDENISLE(20, 0xff0000),
PIRATEISLES(23, 0xff008a),
SWATHMOORE(18, 0xff4200),
ESSENGLUND(2, 0xff9c00),
RELGOTH(13, 0xffde00);
private final int realmID;
private final Color color;
private static final HashMap<Integer, Integer> _rgbToIDMap = new HashMap<>();
RealmType(int realmID, int colorRGB) {
this.realmID = realmID;
this.color = new Color(colorRGB);
}
public void addToColorMap() {
_rgbToIDMap.put(this.color.getRGB(), this.realmID);
}
public static int getRealmIDByRGB(int realmRGB) {
return _rgbToIDMap.get(realmRGB);
}
public int getRealmID() {
return realmID;
}
public static RealmType getRealmTypeByUUID(int realmUUID) {
RealmType returnType = RealmType.SEAFLOOR;
for (RealmType realmType : RealmType.values()) {
if (realmType.realmID == realmUUID)
returnType = realmType;
}
return returnType;
}
}
public enum TaxType {
PROFIT,
WEEKLY,