package mock.model.commandFactory; import mock.model.MockBoat; import mock.model.MockRace; /** * Created by David on 2/08/2017. */ public class TackGybeCommand implements Command { private MockRace race; private MockBoat boat; public TackGybeCommand(MockRace race, MockBoat boat) { this.race = race; this.boat = boat; } //The refactoring of MockRace will require changes to be made @Override public void execute() { boat.setAutoVMG(false); /*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); }*/ } }