Resolved issue #42 - "putting sails out changes boat bearing to face target gate"
#story[1196]
This commit is contained in:
@@ -356,11 +356,6 @@ public class MockRace extends RaceState {
|
||||
|
||||
checkPosition(boat, totalElapsedMilliseconds);
|
||||
|
||||
if (boat.getCurrentSpeed() == 0) {
|
||||
newOptimalVMG(boat);
|
||||
boat.setBearing(boat.calculateBearingToNextMarker());
|
||||
}
|
||||
|
||||
setBoatSpeed(boat);
|
||||
|
||||
//Calculates the distance travelled, in meters, in the current timeslice.
|
||||
|
||||
@@ -7,8 +7,9 @@ import java.util.Observable;
|
||||
|
||||
public class SailsCommand extends ObserverCommand {
|
||||
private boolean sailsOut;
|
||||
private double goalVelocity;
|
||||
|
||||
public SailsCommand(MockRace race, MockBoat boat, Boolean sailsOut) {
|
||||
public SailsCommand(MockRace race, MockBoat boat, boolean sailsOut) {
|
||||
super(race, boat);
|
||||
this.sailsOut = sailsOut;
|
||||
}
|
||||
@@ -16,6 +17,7 @@ public class SailsCommand extends ObserverCommand {
|
||||
@Override
|
||||
public void execute() {
|
||||
this.boat.setSailsOut(this.sailsOut);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user