Added the race results to the RaceResultController. Also fixed some bugs

- Fixed a bug where the race results would be out of order.
- Changed the colour of the start and finish gates
- Added the race results to the RaceResultController and updated view

Tags: #fix #implement #story[13, 10, 11]
This commit is contained in:
Michael Rausch
2017-03-22 22:30:49 +13:00
parent a41f2e4bde
commit 9e22eac4d8
8 changed files with 76 additions and 56 deletions
@@ -55,13 +55,18 @@ public class RaceController {
//get race size
int numberOfBoats = (int) fp.getRaceSize();
int boatsAdded = 0;
//get time scale
double timeScale = fp.getTimeScale();
race.setTimeScale(timeScale);
for (Map<String, Object> team : teams) {
boatNames.add((String) team.get("team-name"));
if (boatsAdded < numberOfBoats){
boatNames.add((String) team.get("team-name"));
race.addBoat(new Boat(team.get("team-name").toString(), (Double) (team.get("velocity"))));
}
boatsAdded++;
}
// Shuffle team names
@@ -72,11 +77,6 @@ public class RaceController {
return null;
}
// Add boats to the race
for (int i = 0; i < numberOfBoats; i++) {
race.addBoat(new Boat(boatNames.get(i), (Double) (teams.get(i).get("velocity"))));
}
CourseParser cp = new CourseParser("doc/examples/course.xml");
race.addCourse(cp.getCourse());