mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-06-06 22:33:38 +08:00
Run IntelliJ IDEA code formatter
This commit is contained in:
@@ -1,42 +1,43 @@
|
||||
package emu.grasscutter.game.props;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
|
||||
public enum FetterState {
|
||||
NONE(0),
|
||||
NOT_OPEN(1),
|
||||
OPEN(1),
|
||||
FINISH(3);
|
||||
|
||||
private final int value;
|
||||
private static final Int2ObjectMap<FetterState> map = new Int2ObjectOpenHashMap<>();
|
||||
private static final Map<String, FetterState> stringMap = new HashMap<>();
|
||||
|
||||
static {
|
||||
Stream.of(values()).forEach(e -> {
|
||||
map.put(e.getValue(), e);
|
||||
stringMap.put(e.name(), e);
|
||||
});
|
||||
}
|
||||
|
||||
private FetterState(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static FetterState getTypeByValue(int value) {
|
||||
return map.getOrDefault(value, NONE);
|
||||
}
|
||||
|
||||
public static FetterState getTypeByName(String name) {
|
||||
return stringMap.getOrDefault(name, NONE);
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.game.props;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public enum FetterState {
|
||||
NONE(0),
|
||||
NOT_OPEN(1),
|
||||
OPEN(1),
|
||||
FINISH(3);
|
||||
|
||||
private static final Int2ObjectMap<FetterState> map = new Int2ObjectOpenHashMap<>();
|
||||
private static final Map<String, FetterState> stringMap = new HashMap<>();
|
||||
|
||||
static {
|
||||
Stream.of(values()).forEach(e -> {
|
||||
map.put(e.getValue(), e);
|
||||
stringMap.put(e.name(), e);
|
||||
});
|
||||
}
|
||||
|
||||
private final int value;
|
||||
|
||||
FetterState(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static FetterState getTypeByValue(int value) {
|
||||
return map.getOrDefault(value, NONE);
|
||||
}
|
||||
|
||||
public static FetterState getTypeByName(String name) {
|
||||
return stringMap.getOrDefault(name, NONE);
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user