|
|
|
|
@ -96,7 +96,7 @@ public abstract class Race implements Runnable {
|
|
|
|
|
System.out.println("====================");
|
|
|
|
|
for (int i = 0; i < startingBoats.size(); i++) {
|
|
|
|
|
if (startingBoats.get(i) != null) {
|
|
|
|
|
System.out.println(i + 1 + ". " + startingBoats.get(i).toString() + ", Speed: "
|
|
|
|
|
System.out.println(i + 1 + ". " + startingBoats.get(i).getName() + ", Speed: "
|
|
|
|
|
+ Math.round(startingBoats.get(i).getVelocity() * 1.94384) + "kn");
|
|
|
|
|
startingBoats.get(i).setCurrentLeg(legs.get(0));
|
|
|
|
|
}
|
|
|
|
|
@ -117,6 +117,7 @@ public abstract class Race implements Runnable {
|
|
|
|
|
long timeLoopEnded;
|
|
|
|
|
|
|
|
|
|
while (currentTime <= startTime) {
|
|
|
|
|
if (controller != null) controller.updateMap(startingBoats);
|
|
|
|
|
timeLeft = startTime - currentTime;
|
|
|
|
|
currentTimeInSeconds = timeLeft / 1000;
|
|
|
|
|
minutes = currentTimeInSeconds / 60;
|
|
|
|
|
@ -146,7 +147,7 @@ public abstract class Race implements Runnable {
|
|
|
|
|
long remainingSeconds;
|
|
|
|
|
long hours;
|
|
|
|
|
|
|
|
|
|
currentTimeInSeconds = totalTimeElapsed / 1000;
|
|
|
|
|
currentTimeInSeconds = (totalTimeElapsed / 1000) * scaleFactor;
|
|
|
|
|
minutes = currentTimeInSeconds / 60;
|
|
|
|
|
remainingSeconds = currentTimeInSeconds % 60;
|
|
|
|
|
hours = minutes / 60;
|
|
|
|
|
@ -186,7 +187,7 @@ 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;
|
|
|
|
|
@ -198,7 +199,7 @@ public abstract class Race implements Runnable {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (controller != null) controller.updateMap(startingBoats);
|
|
|
|
|
//if (controller != null) controller.updateMap(startingBoats);
|
|
|
|
|
if (timerEnabled)
|
|
|
|
|
updateTime(calcTimer());
|
|
|
|
|
}
|
|
|
|
|
|