Sails can be toggled on the visualiser and the rotate sails button rotates the sail visually. #story[1098]
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package visualiser.gameController.Keys;
|
||||
|
||||
import visualiser.model.ThisBoat;
|
||||
|
||||
/**
|
||||
* Key to toggle the sails
|
||||
*/
|
||||
@@ -19,7 +21,16 @@ public class SailsToggleKey extends ControlKey {
|
||||
*/
|
||||
@Override
|
||||
public void onAction() {
|
||||
protocolCode = protocolCode == 2? 3 : 2;
|
||||
// 2 = Sails in
|
||||
// 3 = Sails out
|
||||
if (ThisBoat.getInstance().isSailsOut()) {
|
||||
protocolCode = 3;
|
||||
ThisBoat.getInstance().setSailsOut(false);
|
||||
} else {
|
||||
protocolCode = 2;
|
||||
ThisBoat.getInstance().setSailsOut(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user