Created a setWind(bearing, knots) in Race, which updates the Wind with new values.
MockRace now uses Wind. VisualiserRace now uses Wind. #story[1093]
This commit is contained in:
@@ -166,8 +166,7 @@ public abstract class Race implements Runnable {
|
||||
this.raceType = raceDataSource.getRaceType();
|
||||
|
||||
//Wind.
|
||||
Wind wind = new Wind(Bearing.fromDegrees(0), 0);
|
||||
this.raceWind.setValue(wind);
|
||||
this.setWind(Bearing.fromDegrees(0), 0);
|
||||
|
||||
}
|
||||
|
||||
@@ -248,6 +247,18 @@ public abstract class Race implements Runnable {
|
||||
return regattaName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Updates the race to have a specified wind bearing and speed.
|
||||
* @param windBearing New wind bearing.
|
||||
* @param windSpeedKnots New wind speed, in knots.
|
||||
*/
|
||||
protected void setWind(Bearing windBearing, double windSpeedKnots) {
|
||||
Wind wind = new Wind(windBearing, windSpeedKnots);
|
||||
this.raceWind.setValue(wind);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the wind bearing.
|
||||
* @return The wind bearing.
|
||||
|
||||
Reference in New Issue
Block a user