Added reverse lookup for HologramColour and PvpStatus

This commit is contained in:
Obique PSWG
2016-03-02 00:43:18 -06:00
parent c226add909
commit d7ece0b76a
2 changed files with 26 additions and 2 deletions
+19 -2
View File
@@ -1,19 +1,36 @@
package resources;
import java.util.HashMap;
import java.util.Map;
public enum PvpStatus {
ONLEAVE(0),
COMBATANT(1),
SPECIALFORCES(2);
private static final Map<Integer, PvpStatus> CRC_LOOKUP;
static {
CRC_LOOKUP = new HashMap<>();
for(PvpStatus pvpStatus : values()) {
CRC_LOOKUP.put(pvpStatus.getValue(), pvpStatus);
}
}
private int value;
PvpStatus(int value) {
this.value = value;
PvpStatus(int crc) {
this.value = crc;
}
public int getValue() {
return value;
}
public static PvpStatus getStatusForValue(int crc) {
return CRC_LOOKUP.get(crc);
}
}