Moved wind generation logic and state into the WindGenerator class.
MockRace initialises this, and calls it to update wind.
This commit is contained in:
fjc40
2017-08-02 13:59:19 +12:00
parent 99f3310d8b
commit ed12ff659d
3 changed files with 272 additions and 48 deletions
@@ -255,6 +255,14 @@ public abstract class Race implements Runnable {
*/
protected void setWind(Bearing windBearing, double windSpeedKnots) {
Wind wind = new Wind(windBearing, windSpeedKnots);
setWind(wind);
}
/**
* Updates the race to have a specified wind (bearing and speed).
* @param wind New wind.
*/
protected void setWind(Wind wind) {
this.raceWind.setValue(wind);
}