Boats stop when the sails are out. Merged dev. #story[1098]
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user