Merge branch 'RaceFactory' of https://eng-git.canterbury.ac.nz/seng302-2017/team-7 into RaceFactory
commit
c8621a7be5
@ -1,4 +1,9 @@
|
||||
package mock.model.commandFactory;
|
||||
|
||||
import mock.model.MockBoat;
|
||||
import mock.model.MockRace;
|
||||
|
||||
public interface CommandFactory {
|
||||
|
||||
void runCommand(MockBoat boat, MockRace race);
|
||||
}
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
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.
|
||||
*/
|
||||
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 = 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);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
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.
|
||||
*/
|
||||
public class VMGCommand implements CommandFactory {
|
||||
|
||||
//The refactoring of MockRace will require changes to be made
|
||||
@Override
|
||||
public void runCommand(MockBoat boat, MockRace race) {
|
||||
/*VMG newVMG = boat.getPolars().calculateVMG(
|
||||
race.getWindDirection(),
|
||||
race.getWindSpeed(),
|
||||
boat.calculateBearingToNextMarker(),
|
||||
Bearing.fromDegrees(0d),
|
||||
Bearing.fromDegrees(359.99999d));
|
||||
boat.setVMG(newVMG);*/
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue