Merge branch 'story9' of https://eng-git.canterbury.ac.nz/seng302-2017/team-7 into story9
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
This commit is contained in:
@@ -63,10 +63,20 @@ public abstract class Race implements Runnable {
|
|||||||
|
|
||||||
long timeLoopStarted;
|
long timeLoopStarted;
|
||||||
long timeLoopEnded;
|
long timeLoopEnded;
|
||||||
|
long minutes;
|
||||||
|
long currentTimeInSeconds;
|
||||||
|
long remainingSeconds;
|
||||||
|
|
||||||
|
|
||||||
while (finishingBoats.size() < startingBoats.length) {
|
while (finishingBoats.size() < startingBoats.length) {
|
||||||
timeLoopStarted = System.currentTimeMillis();
|
timeLoopStarted = System.currentTimeMillis();
|
||||||
totalTimeElapsed = System.currentTimeMillis() - timeRaceStarted;
|
totalTimeElapsed = System.currentTimeMillis() - timeRaceStarted;
|
||||||
|
long currentTime = System.currentTimeMillis() - timeRaceStarted;
|
||||||
|
currentTimeInSeconds = currentTime / 1000;
|
||||||
|
minutes = currentTimeInSeconds / 60;
|
||||||
|
remainingSeconds = currentTimeInSeconds % 60;
|
||||||
|
System.out.println(minutes + ":" + remainingSeconds);
|
||||||
|
|
||||||
for (BoatInRace boat : startingBoats) {
|
for (BoatInRace boat : startingBoats) {
|
||||||
updatePosition(boat, SLEEP_TIME);
|
updatePosition(boat, SLEEP_TIME);
|
||||||
checkPosition(boat, totalTimeElapsed);
|
checkPosition(boat, totalTimeElapsed);
|
||||||
|
|||||||
Reference in New Issue
Block a user