Currently, mock/pom.xml and visualiser/pom.xml build racevisionGame mock and visualiser.

Now using jetbrains nullable/notnull instead of sun (was causing maven issues).
This commit is contained in:
fjc40
2017-07-11 03:10:29 +12:00
parent cab9bf9574
commit 3a85fad211
9 changed files with 129 additions and 80 deletions
@@ -1,9 +1,9 @@
package shared.model;
import com.sun.istack.internal.Nullable;
import javafx.beans.property.*;
import network.Messages.Enums.BoatStatusEnum;
import org.jetbrains.annotations.Nullable;
import java.time.ZonedDateTime;
@@ -33,7 +33,7 @@ public class Constants {
* Frame periods are multiplied by this to get the amount of time a single frame represents.
* E.g., frame period = 20ms, scale = 5, frame represents 20 * 5 = 100ms, and so boats are simulated for 100ms, even though only 20ms actually occurred.
*/
public static final int RaceTimeScale = 15;
public static final int RaceTimeScale = 10;
/**
* The race pre-start time, in milliseconds. 3 minutes.
@@ -1,14 +1,11 @@
package shared.model;
import com.github.bfsmith.geotimezone.TimeZoneLookup;
import com.github.bfsmith.geotimezone.TimeZoneResult;
import com.sun.istack.internal.Nullable;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import org.jetbrains.annotations.Nullable;
import visualiser.model.ResizableRaceCanvas;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
@@ -91,20 +88,6 @@ public class RaceClock {
}
//TODO could potentially remove this, and the dependency, as it doesn't appear to be needed (regatta.xml has timezone already).
/**
* Returns the ZonedDateTime corresponding to a specified GPSCoordinate.
* @param gpsCoordinate The GPSCoordinate to lookup.
* @return The ZonedDateTime for the coordinate.
*/
public static ZonedDateTime getCurrentZonedDateTime(GPSCoordinate gpsCoordinate) {
TimeZoneLookup timeZoneLookup = new TimeZoneLookup();
TimeZoneResult timeZoneResult = timeZoneLookup.getTimeZone(gpsCoordinate.getLatitude(), gpsCoordinate.getLongitude());
ZoneId zone = ZoneId.of(timeZoneResult.getResult());
return LocalDateTime.now(zone).atZone(zone);
}
/**
@@ -227,6 +210,7 @@ public class RaceClock {
* Returns the current time of the race.
* @return The current time of the race.
*/
@Nullable
public ZonedDateTime getCurrentTime() {
return currentTime;
}