mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 22:38:43 +00:00
4011295b8b
- optimised UI - check conflicts when change key bind if the key has already been in use - abstract keybind as a separate singleton class so all class can access it - [WIP] turning mode is need to be finished #story[1245]
36 lines
675 B
Java
36 lines
675 B
Java
package seng302.model;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
public enum KeyAction {
|
|
ZOOM_IN(1),
|
|
ZOOM_OUT(2),
|
|
VMG(3),
|
|
SAILS_STATE(4),
|
|
TACK_GYBE(5),
|
|
UPWIND(6),
|
|
DOWNWIND(7);
|
|
|
|
private final int type;
|
|
private static final Map<Integer, KeyAction> intToTypeMap = new HashMap<>();
|
|
|
|
static {
|
|
for (KeyAction type : KeyAction.values()) {
|
|
intToTypeMap.put(type.getValue(), type);
|
|
}
|
|
}
|
|
|
|
KeyAction(int type) {
|
|
this.type = type;
|
|
}
|
|
|
|
public static KeyAction getType(int value) {
|
|
return intToTypeMap.get(value);
|
|
}
|
|
|
|
public int getValue() {
|
|
return this.type;
|
|
}
|
|
}
|