Boats stop when the sails are out. Merged dev. #story[1098]

This commit is contained in:
Joseph Gardner
2017-08-10 12:32:05 +12:00
parent 1302769a50
commit 1a7152f54e
4 changed files with 10 additions and 8 deletions
@@ -19,8 +19,8 @@ public class CommandFactory {
switch(action) {
case AUTO_PILOT: return new VMGCommand(race, boat);
case TACK_GYBE: return new TackGybeCommand(race, boat);
case SAILS_IN: return new TackGybeCommand(race, boat);
case SAILS_OUT: return new TackGybeCommand(race, boat);
case SAILS_IN: return new SailsInCommand(race, boat);
case SAILS_OUT: return new SailsOutCommand(race, boat);
default: return null; // TODO - please please have discussion over what to default to
}
}
@@ -15,5 +15,6 @@ public class SailsInCommand implements Command {
@Override
public void execute() {
this.boat.setSailsOut(false);
System.out.println("hi");
}
}
@@ -14,8 +14,7 @@ public class SailsOutCommand implements Command {
@Override
public void execute() {
System.out.println("hi");
this.boat.setCurrentSpeed(0);
this.boat.setSailsOut(true);
System.out.println("hi2");
}
}