mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
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:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user