Merge remote-tracking branch 'origin/story9' into story9

# Conflicts:
#	src/main/java/seng302/Model/Race.java
main
David Wu 9 years ago
commit 1842b8f0b2

@ -1,5 +1,7 @@
package seng302;
import javafx.scene.paint.Color;
import seng302.Model.BoatInRace;
import seng302.Model.Leg;
/**
@ -22,5 +24,13 @@ public class Constants {
public static final GPSCoordinate finishLineMarker1 = new GPSCoordinate(32.317379, -64.839291);
public static final GPSCoordinate finishLineMarker2 = new GPSCoordinate(32.317257, -64.836260);
public static final BoatInRace[] OFFICIAL_AC35_COMPETITORS = new BoatInRace[]
{new BoatInRace("Oracle Team USA", 200.0, Color.BLUEVIOLET),
new BoatInRace("Land Rover BAR", 180.0, Color.BLACK),
new BoatInRace("SoftBank Team Japan", 190.0, Color.RED),
new BoatInRace("Groupama Team France", 210.0, Color.ORANGE),
new BoatInRace("Artemis Racing", 220.0, Color.DARKOLIVEGREEN),
new BoatInRace("Emirates Team New Zealand", 310, Color.LIMEGREEN)};
//public static final Leg bermudaCourseStartToMark1 = new Leg(0, , new )
}

@ -115,18 +115,17 @@ public class RaceController extends Controller{
private BoatInRace[] generateAC35Competitors() {
BoatInRace boat1 = new BoatInRace("NZ", 500);
boat1.setColour(Color.DARKVIOLET);
boat1.setCurrentPosition(new GPSCoordinate(0, 0));
BoatInRace boat2 = new BoatInRace("TEST", 400);
boat2.setColour(Color.DARKRED);
boat2.setCurrentPosition(new GPSCoordinate(0, 0));
BoatInRace boat3 = new BoatInRace("TEST2", 350);
boat3.setColour(Color.FUCHSIA);
boat3.setCurrentPosition(new GPSCoordinate(0, 0));
return new BoatInRace[] {boat1, boat2, boat3};
BoatInRace[] boats = new BoatInRace[6];
int i = 0;
for (BoatInRace boat : Constants.OFFICIAL_AC35_COMPETITORS) {
boat.setCurrentPosition(Constants.startLineMarker1);
boats[i] = boat;
i++;
}
return boats;
}

@ -19,6 +19,17 @@ public class BoatInRace extends Boat {
private Color colour;
private boolean finished = false;
/**
* Constructor method.
* @param name Name of the boat.
* @param velocity Speed that the boat travels.
* @param colour Colour the boat will be displayed as on the map
*/
public BoatInRace(String name, double velocity, Color colour) {
super(name, velocity);
setColour(colour);
}
/**
*
* @return Returns the current position of the boat in a GPSCoordinate Class.
@ -61,15 +72,6 @@ public class BoatInRace extends Boat {
this.timeFinished = timeFinished;
}
/**
* Constructor method.
* @param name Name of the boat.
* @param velocity Speed that the boat travels.
*/
public BoatInRace(String name, double velocity) {
super(name, velocity);
}
/**
* Gets the current leg that the boat is on.
* @return returns the leg the boat is on in a Leg class

@ -67,7 +67,8 @@ public abstract class Race implements Runnable {
System.out.println("====================");
for (int i = 0; i < startingBoats.size(); i++) {
if (startingBoats.get(i) != null) {
System.out.println(i + 1 + ". " + startingBoats.get(i).getName() + ", Speed: " + Math.round(startingBoats.get(i).getVelocity() * 1.94384) + "kn");
System.out.println(i + 1 + ". " + startingBoats.get(i).getName() + ", Speed: "
+ Math.round(startingBoats.get(i).getVelocity() * 1.94384) + "kn");
startingBoats.get(i).setCurrentLeg(legs.get(0));
}
}

Loading…
Cancel
Save