mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Re-added wind speed & direction variations
- Wind speed & direction are randomly updated - Removed two duplicate threads ;) Tags: #story[1124]
This commit is contained in:
@@ -73,6 +73,9 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
||||
private ComboBox<ClientYacht> yachtSelectionComboBox;
|
||||
@FXML
|
||||
private Text fpsDisplay;
|
||||
@FXML
|
||||
private Text windSpeedText;
|
||||
|
||||
//Race Data
|
||||
private Map<Integer, ClientYacht> participants;
|
||||
private Map<Integer, CompoundMark> markers;
|
||||
@@ -102,8 +105,7 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
||||
|
||||
public void loadRace (
|
||||
Map<Integer, ClientYacht> participants, RaceXMLData raceData, RaceState raceState,
|
||||
ClientYacht player
|
||||
) {
|
||||
ClientYacht player) {
|
||||
this.participants = participants;
|
||||
this.courseData = raceData;
|
||||
this.markers = raceData.getCompoundMarks();
|
||||
@@ -315,7 +317,7 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
||||
@Override
|
||||
public void run() {
|
||||
updateRaceTime();
|
||||
updateWindDirection();
|
||||
updateWind();
|
||||
updateOrder();
|
||||
// updateSparkLine();
|
||||
}
|
||||
@@ -355,9 +357,11 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
||||
/**
|
||||
* Updates the wind direction arrow and text as from info from the StreamParser
|
||||
*/
|
||||
private void updateWindDirection() {
|
||||
private void updateWind() {
|
||||
windDirectionText.setText(String.format("%.1f°", raceState.getWindDirection()));
|
||||
windArrowText.setRotate(raceState.getWindDirection());
|
||||
|
||||
windSpeedText.setText("Speed: " + String.format("%.1f", raceState.getWindSpeed()) + " Knots");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user