feat: add handling and checking for MindStone
This commit is contained in:
@ -13,20 +13,19 @@ public enum StoneType {
|
||||
SoulStone(5);
|
||||
|
||||
private final int id;
|
||||
private final static HashMap<Integer, StoneType> map;
|
||||
private final static HashMap<Integer, StoneType> map = new HashMap<>();
|
||||
|
||||
private StoneType(int id) {
|
||||
StoneType(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
static {
|
||||
map = new HashMap<>();
|
||||
for (StoneType stoneType : StoneType.values()) {
|
||||
for (StoneType stoneType: StoneType.values()) {
|
||||
map.put(stoneType.id, stoneType);
|
||||
}
|
||||
}
|
||||
|
||||
public static StoneType valueOf (int stoneType) {
|
||||
public static StoneType valueOf(int stoneType) {
|
||||
return map.get(stoneType);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user