Added test for WindCommand

#story[1096]
This commit is contained in:
Connor Taylor-Brown
2017-08-07 14:13:14 +12:00
parent 554f8a2a0f
commit e76de1cbf9
2 changed files with 34 additions and 6 deletions
@@ -12,6 +12,8 @@ public class WindCommand implements Command {
private MockBoat boat;
private int direction;
private double offset = 3.0;
public WindCommand(MockRace race, MockBoat boat, boolean upwind) {
this.race = race;
this.boat = boat;
@@ -23,7 +25,6 @@ public class WindCommand implements Command {
double wind = race.getWindDirection().degrees();
double heading = boat.getBearing().degrees();
double offset = 3;
if(wind - heading < 0) offset *= -1 * direction;
boat.setBearing(Bearing.fromDegrees(heading + offset));
}