Added test for WindCommand
#story[1096]
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user