Merge branch 'master' into wind_(story53)

This commit is contained in:
Joseph Gardner
2017-08-29 13:22:15 +12:00
50 changed files with 157 additions and 2047 deletions
@@ -92,11 +92,8 @@ public class HeartBeatService implements RunnableWithFramePeriod {
while (!Thread.interrupted()) {
long currentFrameTime = System.currentTimeMillis();
try {
waitForFramePeriod(lastHeartbeatTime, currentFrameTime, heartbeatPeriod);
} catch (Exception e) {
e.printStackTrace();
}
waitForFramePeriod(lastHeartbeatTime, currentFrameTime, heartbeatPeriod);
lastHeartbeatTime = currentFrameTime;
try {
@@ -50,17 +50,9 @@ public class RaceLogic implements RunnableWithFramePeriod, Observer {
public void run() {
race.initialiseBoats();
try {
countdown();
} catch (Exception e) {
e.printStackTrace();
}
countdown();
try {
raceLoop();
} catch (Exception e) {
e.printStackTrace();
}
raceLoop();
}
public void boolFalse(){
@@ -71,7 +63,7 @@ public class RaceLogic implements RunnableWithFramePeriod, Observer {
/**
* Countdown timer until race starts.
*/
private void countdown() throws Exception {
private void countdown() {
long previousFrameTime = System.currentTimeMillis();
@@ -110,7 +102,7 @@ public class RaceLogic implements RunnableWithFramePeriod, Observer {
/**
* Timer that runs for the duration of the race, until all boats finish.
*/
private void raceLoop() throws Exception {
private void raceLoop() {
long previousFrameTime = System.currentTimeMillis();
@@ -199,4 +191,4 @@ public class RaceLogic implements RunnableWithFramePeriod, Observer {
// else if(e.getBearing().degrees() > 270) System.out.println("Port");
// else System.out.println("Behind");
}
}
}