|
|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package visualiser.gameController.Keys;
|
|
|
|
|
|
|
|
|
|
import javafx.scene.input.KeyCode;
|
|
|
|
|
import network.Messages.Enums.BoatActionEnum;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Key for the controller, part of the abstract factory KeyFactory
|
|
|
|
|
@ -8,14 +9,14 @@ import javafx.scene.input.KeyCode;
|
|
|
|
|
public abstract class ControlKey {
|
|
|
|
|
|
|
|
|
|
private String name;
|
|
|
|
|
protected int protocolCode;
|
|
|
|
|
protected BoatActionEnum protocolCode;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Constructor for key state with specified protocol code
|
|
|
|
|
* @param name of action
|
|
|
|
|
* @param protocolCode -1 if not sent
|
|
|
|
|
* @param protocolCode NOT_A_STATUS if not sent
|
|
|
|
|
*/
|
|
|
|
|
public ControlKey(String name, int protocolCode) {
|
|
|
|
|
public ControlKey(String name, BoatActionEnum protocolCode) {
|
|
|
|
|
this.name = name;
|
|
|
|
|
this.protocolCode = protocolCode;
|
|
|
|
|
}
|
|
|
|
|
@ -26,10 +27,10 @@ public abstract class ControlKey {
|
|
|
|
|
*/
|
|
|
|
|
public ControlKey(String name){
|
|
|
|
|
this.name = name;
|
|
|
|
|
this.protocolCode = -1;
|
|
|
|
|
this.protocolCode = BoatActionEnum.NOT_A_STATUS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getProtocolCode() {
|
|
|
|
|
public BoatActionEnum getProtocolCode() {
|
|
|
|
|
return protocolCode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|