|
|
|
|
@ -117,7 +117,7 @@ public abstract class Race implements Runnable {
|
|
|
|
|
long timeLoopEnded;
|
|
|
|
|
|
|
|
|
|
while (currentTime <= startTime) {
|
|
|
|
|
if (controller != null) controller.updateMap(startingBoats);
|
|
|
|
|
//if (controller != null) controller.updateMap(startingBoats);
|
|
|
|
|
timeLeft = startTime - currentTime;
|
|
|
|
|
currentTimeInSeconds = timeLeft / 1000;
|
|
|
|
|
minutes = currentTimeInSeconds / 60;
|
|
|
|
|
@ -163,6 +163,10 @@ public abstract class Race implements Runnable {
|
|
|
|
|
Platform.runLater(() -> {controller.setTimer(time);});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Update the calculated fps to the fps label
|
|
|
|
|
* @param fps The new calculated fps value
|
|
|
|
|
*/
|
|
|
|
|
private void updateFPS(int fps) {
|
|
|
|
|
Platform.runLater(() -> {controller.setFrames("FPS: " + fps);});
|
|
|
|
|
}
|
|
|
|
|
@ -187,7 +191,6 @@ public abstract class Race implements Runnable {
|
|
|
|
|
/*long timeLoopStarted;
|
|
|
|
|
long timeLoopEnded;
|
|
|
|
|
int fps = 0;*/
|
|
|
|
|
if (controller != null) controller.updateMap(startingBoats);
|
|
|
|
|
if (boatsFinished < startingBoats.size()) {
|
|
|
|
|
//timeLoopStarted = System.currentTimeMillis();
|
|
|
|
|
totalTimeElapsed = System.currentTimeMillis() - timeRaceStarted;
|
|
|
|
|
@ -199,7 +202,7 @@ public abstract class Race implements Runnable {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//if (controller != null) controller.updateMap(startingBoats);
|
|
|
|
|
if (controller != null) controller.updateMap(startingBoats);
|
|
|
|
|
if (timerEnabled)
|
|
|
|
|
updateTime(calcTimer());
|
|
|
|
|
}
|
|
|
|
|
@ -210,8 +213,6 @@ public abstract class Race implements Runnable {
|
|
|
|
|
timeCurrent = System.currentTimeMillis();
|
|
|
|
|
}
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*fps++;
|
|
|
|
|
try {
|
|
|
|
|
timeLoopEnded = System.currentTimeMillis();
|
|
|
|
|
@ -272,7 +273,6 @@ public abstract class Race implements Runnable {
|
|
|
|
|
* Is automatically called by the initialiser function, so that simulateRace() does not return an empty race.
|
|
|
|
|
* @see Race#simulateRace()
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
protected abstract void updatePosition(BoatInRace boat, int millisecondsElapsed);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|