mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Merge branch 'develop' into Story80_BoatCustomization
# Conflicts: # src/main/java/seng302/visualiser/GameClient.java # src/main/java/seng302/visualiser/controllers/LobbyController.java
This commit is contained in:
@@ -17,10 +17,10 @@ public class RaceState {
|
||||
|
||||
private double windSpeed;
|
||||
private double windDirection;
|
||||
private long raceTime;
|
||||
private long serverSystemTime;
|
||||
private long expectedStartTime;
|
||||
private boolean isRaceStarted = false;
|
||||
// long timeTillStart;
|
||||
long timeTillStart;
|
||||
|
||||
public RaceState() {
|
||||
}
|
||||
@@ -28,7 +28,7 @@ public class RaceState {
|
||||
public void updateState (RaceStatusData data) {
|
||||
this.windSpeed = data.getWindSpeed();
|
||||
this.windDirection = data.getWindDirection();
|
||||
this.raceTime = data.getCurrentTime();
|
||||
this.serverSystemTime = data.getCurrentTime();
|
||||
this.expectedStartTime = data.getExpectedStartTime();
|
||||
this.isRaceStarted = data.isRaceStarted();
|
||||
}
|
||||
@@ -38,16 +38,20 @@ public class RaceState {
|
||||
}
|
||||
|
||||
public void updateState (RaceStartData data) {
|
||||
// this.timeTillStart = data.getRaceStartTime();
|
||||
System.out.println(data.getRaceStartTime());
|
||||
this.timeTillStart = data.getRaceStartTime();
|
||||
}
|
||||
|
||||
public String getRaceTimeStr () {
|
||||
return DATE_TIME_FORMAT.format(raceTime);
|
||||
long raceTime = serverSystemTime - expectedStartTime;
|
||||
if (raceTime < 0) {
|
||||
return "-" + DATE_TIME_FORMAT.format(-1 * (raceTime - 1000));
|
||||
} else {
|
||||
return DATE_TIME_FORMAT.format(serverSystemTime - expectedStartTime);
|
||||
}
|
||||
}
|
||||
|
||||
public long getTimeTillStart () {
|
||||
return (expectedStartTime - raceTime) / 1000;
|
||||
return (expectedStartTime - serverSystemTime);
|
||||
}
|
||||
|
||||
public double getWindSpeed() {
|
||||
@@ -59,11 +63,7 @@ public class RaceState {
|
||||
}
|
||||
|
||||
public long getRaceTime() {
|
||||
return raceTime;
|
||||
}
|
||||
|
||||
public long getExpectedStartTime() {
|
||||
return expectedStartTime;
|
||||
return serverSystemTime;
|
||||
}
|
||||
|
||||
public boolean isRaceStarted () {
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ServerYacht extends Observable {
|
||||
this.country = country;
|
||||
this.sailIn = false;
|
||||
this.isAuto = false;
|
||||
this.location = new GeoPoint(57.670341, 11.826856);
|
||||
this.location = new GeoPoint(57.67046, 11.83751);
|
||||
this.lastLocation = location;
|
||||
this.heading = 120.0; //In degrees
|
||||
this.currentVelocity = 0d; //in mms-1
|
||||
|
||||
@@ -18,10 +18,10 @@ public class Regatta {
|
||||
private Integer utcOffset;
|
||||
private Double magneticVariation;
|
||||
|
||||
public Regatta(String name, Double latitude, Double longitude) {
|
||||
public Regatta(String name, String courseName, Double latitude, Double longitude) {
|
||||
this.name = name;
|
||||
this.id = DEFAULT_REGATTA_ID;
|
||||
this.courseName = name;
|
||||
this.courseName = courseName;
|
||||
|
||||
this.latitude = latitude;
|
||||
this.longitude = longitude;
|
||||
|
||||
Reference in New Issue
Block a user