|
|
|
|
@ -95,8 +95,6 @@ public class Race implements Runnable {
|
|
|
|
|
*/
|
|
|
|
|
public void run() {
|
|
|
|
|
initialiseBoats();
|
|
|
|
|
|
|
|
|
|
System.out.println("Beginning");
|
|
|
|
|
countdownTimer();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -119,7 +117,6 @@ public class Race implements Runnable {
|
|
|
|
|
@Override
|
|
|
|
|
public void handle(long arg0) {
|
|
|
|
|
timeLeft = startTime - currentTime;
|
|
|
|
|
System.out.println(timeLeft);
|
|
|
|
|
if (timeLeft <= 0) {
|
|
|
|
|
countdownFinish = true;
|
|
|
|
|
stop();
|
|
|
|
|
@ -146,7 +143,6 @@ public class Race implements Runnable {
|
|
|
|
|
*/
|
|
|
|
|
private void simulateRace() {
|
|
|
|
|
|
|
|
|
|
System.out.println("Running");
|
|
|
|
|
System.setProperty("javafx.animation.fullspeed", "true");
|
|
|
|
|
|
|
|
|
|
for (Boat boat : startingBoats) {
|
|
|
|
|
@ -174,7 +170,7 @@ public class Race implements Runnable {
|
|
|
|
|
updatePosition(boat, Math.round(1000 / lastFPS) > 20 ? 15 : Math.round(1000 / lastFPS));
|
|
|
|
|
checkPosition(boat, totalTimeElapsed);
|
|
|
|
|
}
|
|
|
|
|
mockOutput.parseBoatLocation(boat.getSourceID(), boat.getCurrentPosition().getLatitude(), boat.getCurrentPosition().getLongitude());
|
|
|
|
|
mockOutput.parseBoatLocation(boat.getSourceID(), boat.getCurrentPosition().getLatitude(), boat.getCurrentPosition().getLongitude(), boat.getHeading());
|
|
|
|
|
boatStatusMessages.add(new BoatStatusMessage(boat.getSourceID(),
|
|
|
|
|
boat.getCurrentLeg().getLegNumber() >= 0 ? BoatStatus.RACING : BoatStatus.DNF, boat.getCurrentLeg().getLegNumber()));
|
|
|
|
|
} else {
|
|
|
|
|
|