mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
066557584f
- when the mode is toggled, a boat action package will be sent to notify server to change the boat's turning mode - turning mode toggle is now fully functional #story[1245]
42 lines
796 B
Java
42 lines
796 B
Java
package seng302.gameServer.messages;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* Created by kre39 on 12/07/17.
|
|
*/
|
|
public enum BoatAction {
|
|
|
|
VMG(1),
|
|
SAILS_IN(2),
|
|
SAILS_OUT(3),
|
|
TACK_GYBE(4),
|
|
UPWIND(5),
|
|
DOWNWIND(6),
|
|
MAINTAIN_HEADING(7),
|
|
CONTINUOUSLY_TURNING(8),
|
|
DEFAULT_TURNING(9);
|
|
|
|
private final int type;
|
|
private static final Map<Integer, BoatAction> intToTypeMap = new HashMap<>();
|
|
|
|
static {
|
|
for (BoatAction type : BoatAction.values()) {
|
|
intToTypeMap.put(type.getValue(), type);
|
|
}
|
|
}
|
|
|
|
BoatAction(int type){
|
|
this.type = type;
|
|
}
|
|
|
|
public static BoatAction getType(int value) {
|
|
return intToTypeMap.get(value);
|
|
}
|
|
|
|
public int getValue() {
|
|
return this.type;
|
|
}
|
|
}
|