Added Display of all Boats participating in the race, and a message to seperate this and the events in the console.

This commit is contained in:
Fan-Wu Yang
2017-03-08 15:35:40 +13:00
parent 377683ef8c
commit f62c4dcb3d
4 changed files with 58 additions and 42 deletions
+10 -1
View File
@@ -17,7 +17,16 @@ public class Race {
}
public void simulateRace(){
//printRace()
//show the boats participating.
System.out.println("Boats Participating.");
System.out.println("====================");
for (int i = 0; i < boats.length; i ++){
System.out.println(i + 1 + ". " + boats[i].getName());
}
System.out.println("\nRace Events");
System.out.println("====================");
//show all the events that happen in the race
for (Event event: events) {
Timer timer = new Timer();
timer.schedule(new TimerTask(){