|
|
|
|
@ -3,6 +3,7 @@ package mock.model.commandFactory;
|
|
|
|
|
import mock.model.MockBoat;
|
|
|
|
|
import mock.model.MockRace;
|
|
|
|
|
import mock.model.VMG;
|
|
|
|
|
import shared.model.Bearing;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Created by David on 2/08/2017.
|
|
|
|
|
@ -12,10 +13,15 @@ public class TackGybeCommand implements CommandFactory {
|
|
|
|
|
//The refactoring of MockRace will require changes to be made
|
|
|
|
|
@Override
|
|
|
|
|
public void runCommand(MockBoat boat, MockRace race) {
|
|
|
|
|
VMG newVMG = race.calculateVMG(boat);
|
|
|
|
|
/*VMG newVMG = boat.getPolars().calculateVMG(
|
|
|
|
|
race.getWindDirection(),
|
|
|
|
|
race.getWindSpeed(),
|
|
|
|
|
boat.calculateBearingToNextMarker(),
|
|
|
|
|
Bearing.fromDegrees(0d),
|
|
|
|
|
Bearing.fromDegrees(359.99999d));
|
|
|
|
|
VMG boatVMG = new VMG(boat.getCurrentSpeed(), boat.getBearing());
|
|
|
|
|
if(race.improvesVelocity(boatVMG, newVMG, boat.calculateBearingToNextMarker())){
|
|
|
|
|
boat.setVMG(newVMG);
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|