Changed getMark to getThisMark. Added start point to KeyFrame. Race now starts from start point and ends at finish point

#story[377]
This commit is contained in:
zyt10
2017-03-20 17:34:24 +13:00
parent ee34e5028f
commit 0e4bb0f942
3 changed files with 12 additions and 5 deletions
@@ -82,8 +82,8 @@ public class CanvasController {
for (Event event : events) { for (Event event : events) {
keyFrames.add( keyFrames.add(
new KeyFrame(Duration.seconds(event.getTime() / 60 / 60 / 5), new KeyFrame(Duration.seconds(event.getTime() / 60 / 60 / 5),
new KeyValue(x, event.getMark().getLatitude()), new KeyValue(x, event.getThisMark().getLatitude()),
new KeyValue(y, event.getMark().getLongitude()) new KeyValue(y, event.getThisMark().getLongitude())
) )
); );
} }
+3 -3
View File
@@ -147,8 +147,8 @@ public class Event {
* *
* @return the mark * @return the mark
*/ */
public Mark getMark() { public Mark getThisMark() {
return this.mark2; return this.mark1;
} }
/** /**
@@ -157,6 +157,6 @@ public class Event {
* @return the next mark * @return the next mark
*/ */
public Mark getNextMark() { public Mark getNextMark() {
return this.mark1; return this.mark2;
} }
} }
+7
View File
@@ -100,6 +100,13 @@ public class Race {
} }
totalDistance += event.getDistanceBetweenMarks(); totalDistance += event.getDistanceBetweenMarks();
} }
// There are no more marks after this event
else{
Event event = new Event(time, boat, course.get(i), course.get(i));
events.get(boat).add(event);
}
} }
} }
} }