Sails can be toggled on the visualiser and the rotate sails button rotates the sail visually. #story[1098]

This commit is contained in:
Joseph Gardner
2017-08-07 15:01:16 +12:00
parent 7c5670f8c2
commit f6cdf66bfe
4 changed files with 69 additions and 6 deletions
@@ -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