Merge remote-tracking branch 'origin/story9' into story9

# Conflicts:
#	.idea/compiler.xml
#	.idea/misc.xml
This commit is contained in:
David Wu
2017-03-20 15:34:12 +13:00
6 changed files with 13 additions and 62 deletions
@@ -17,6 +17,7 @@ public class BoatInRace extends Boat {
private GPSCoordinate currentPosition;
private long timeFinished;
private Color colour;
private boolean finished = false;
/**
*
@@ -112,6 +113,14 @@ public class BoatInRace extends Boat {
this.distanceTravelledInLeg = distanceTravelledInLeg;
}
public boolean isFinished() {
return this.finished;
}
public void setFinished(boolean bool) {
this.finished = bool;
}
/**
* Calculates the bearing of the travel via map coordinates of the raceMarkers
+2 -2
View File
@@ -110,7 +110,7 @@ public abstract class Race implements Runnable {
for (BoatInRace boat : startingBoats) {
if (boat != null) {
if (boat != null && !boat.isFinished()) {
updatePosition(boat, SLEEP_TIME);
checkPosition(boat, totalTimeElapsed);
}
@@ -139,8 +139,8 @@ public abstract class Race implements Runnable {
//boat has passed onto new leg
if (boat.getCurrentLeg().getName().equals("Finish")) {
//boat has finished
boat.setTimeFinished(timeElapsed);
boatsFinished++;
boat.setFinished(true);
} else {
boat.setDistanceTravelledInLeg(boat.getDistanceTravelledInLeg() - boat.getCurrentLeg().getDistance());
Leg nextLeg = legs.get(boat.getCurrentLeg().getLegNumber() + 1);
@@ -164,7 +164,7 @@ public class ResizableRaceCanvas extends Canvas {
if (boats != null) {
for (BoatInRace boat : boats) {
if (boat != null) {
System.out.print("Drawing Boat At: " + boat.getCurrentPosition());
// System.out.print("Drawing Boat At: " + boat.getCurrentPosition());
displayMark(this.map.convertGPS(boat.getCurrentPosition()), boat.getColour());
}
}
@@ -183,7 +183,7 @@ public class ResizableRaceCanvas extends Canvas {
*/
public void drawBoat(Color colour, GPSCoordinate gpsCoordinates) {
GraphCoordinate graphCoordinate = this.map.convertGPS(gpsCoordinates);
System.out.println("DrawingBoat" + gpsCoordinates.getLongitude());
//System.out.println("DrawingBoat" + gpsCoordinates.getLongitude());
displayPoint(graphCoordinate, colour);
}