Added a visual indicator of wind speed during race (text box)

#pair[kre39,mra106] #story[1040]
This commit is contained in:
Kusal Ekanayake
2017-07-25 15:22:46 +12:00
parent 3785cd705f
commit 539197cef5
4 changed files with 10 additions and 1 deletions
@@ -51,6 +51,8 @@ import java.util.stream.Collectors;
*/
public class RaceViewController extends Thread implements ImportantAnnotationDelegate {
@FXML
private Text windSpeedText;
@FXML
private LineChart raceSparkLine;
@FXML
@@ -335,6 +337,7 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
private void updateWindDirection() {
windDirectionText.setText(String.format("%.1f°", ClientPacketParser.getWindDirection()));
windArrowText.setRotate(ClientPacketParser.getWindDirection());
windSpeedText.setText(String.format("%.1f Knots", ClientPacketParser.getWindSpeed()));
}
@@ -25,7 +25,7 @@ public class GameState {
public GameState(String hostIpAddress) {
windDirection = 170d;
windSpeed = 1300d;
windSpeed = 10000d;
yachts = new HashMap<>();
players = new ArrayList<>();
@@ -11,6 +11,7 @@ public class RaceStatusMessage extends Message{
private final int MESSAGE_BASE_SIZE = 24;
private final double windDirFactor = 0x4000 / 90;
private long currentTime;
private long raceId;
private RaceStatus raceStatus;