Boats now display knots, also the racecouse has been modified to reflect the AC35 racecourse via linear coordinates.
This commit is contained in:
@@ -19,18 +19,17 @@ public class App
|
||||
Boat boat5 = new Boat("Land Rover BAR", 10);
|
||||
Boat boat6 = new Boat("SoftBank Team Japan", 9);
|
||||
|
||||
RaceMarker mark1 = new RaceMarker("Start", 0, 0, 0);
|
||||
RaceMarker mark2 = new RaceMarker("Mark", 120, 120, 0);
|
||||
RaceMarker mark3 = new RaceMarker("Leeward Gate", 240, 240, 0);
|
||||
RaceMarker mark4 = new RaceMarker("Windward Gate", 360, 240, 120);
|
||||
RaceMarker mark5 = new RaceMarker("Leeward Gate", 480, 240, 0);
|
||||
RaceMarker mark6 = new RaceMarker("Finish", 600, 360, 0);
|
||||
RaceMarker mark1 = new RaceMarker("Start", 0, 0, 59);
|
||||
RaceMarker mark2 = new RaceMarker("Mark", 72, 72, 50);
|
||||
RaceMarker mark3 = new RaceMarker("Leeward Gate", 193, 126, 158);
|
||||
RaceMarker mark4 = new RaceMarker("Windward Gate", 373, 41, 0);
|
||||
RaceMarker mark5 = new RaceMarker("Leeward Gate", 553, 126, 158);
|
||||
RaceMarker mark6 = new RaceMarker("Finish", 607, 95, 203);
|
||||
|
||||
Boat[] boats = {boat1, boat2, boat3, boat4, boat5, boat6};
|
||||
RaceMarker[] marks = {mark1, mark2, mark3, mark4, mark5, mark6};
|
||||
|
||||
Race race = new ConstantVelocityRace(boats, marks);
|
||||
race.simulateRace();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class Event {
|
||||
public String toString() {
|
||||
String stringToReturn = boat.getName() + " passed " + raceMarker.toString() + " at " + time + " seconds";
|
||||
if (goalMarker != null){
|
||||
stringToReturn += " at heading " + calculateHeading();
|
||||
stringToReturn += " at heading " + (int) calculateHeading();
|
||||
}
|
||||
stringToReturn += ".";
|
||||
return stringToReturn;
|
||||
|
||||
@@ -21,7 +21,7 @@ public class Race {
|
||||
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(i + 1 + ". " + boats[i].getName() + ", Speed: " + Math.round(boats[i].getVelocity() * 1.94384) + "kn");
|
||||
}
|
||||
|
||||
System.out.println("\nRace Events");
|
||||
|
||||
Reference in New Issue
Block a user