mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
132a729758
tags: #story[1273]
41 lines
751 B
Java
41 lines
751 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),
|
|
VIEW(8),
|
|
RIGHT(9),
|
|
LEFT(10),
|
|
FORWARD(11),
|
|
BACKWARD(12);
|
|
|
|
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;
|
|
}
|
|
}
|