Merge branch 'develop' into 38b_LayLines

# Conflicts:
#	src/main/java/seng302/controllers/RaceViewController.java
#	src/main/java/seng302/models/Yacht.java
This commit is contained in:
William Muir
2017-05-25 09:19:42 +12:00
17 changed files with 659 additions and 80 deletions
+18 -5
View File
@@ -2,6 +2,7 @@ package seng302.models;
import javafx.scene.paint.Color;
import seng302.models.mark.Mark;
import seng302.controllers.RaceViewController;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@@ -11,9 +12,10 @@ import seng302.models.stream.XMLParser.RaceXMLObject.Corner;
* Yacht class for the racing boat.
*
* Class created to store more variables (eg. boat statuses) compared to the XMLParser boat class,
* also done outside Boat class because some old variables are not used anymore.
* also done outside Boat class because some old variables are not used anymore.
*/
public class Yacht {
// Used in boat group
private Color colour;
private double velocity;
@@ -37,21 +39,22 @@ public class Yacht {
private Mark lastMarkRounded;
private Mark nextMark;
/**
* Used in EventTest and RaceTest.
*
* @param boatName Create a yacht object with name.
*/
public Yacht (String boatName) {
public Yacht(String boatName) {
this.boatName = boatName;
}
/**
* Used in BoatGroupTest.
*
* @param boatName The name of the team sailing the boat
* @param boatName The name of the team sailing the boat
* @param boatVelocity The speed of the boat in meters/second
* @param shortName A shorter version of the teams name
* @param shortName A shorter version of the teams name
*/
public Yacht(String boatName, double boatVelocity, String shortName, int id) {
this.boatName = boatName;
@@ -60,30 +63,37 @@ public class Yacht {
this.sourceID = id;
}
public Yacht(String boatType, Integer sourceID, String hullID, String shortName, String boatName, String country) {
public Yacht(String boatType, Integer sourceID, String hullID, String shortName,
String boatName, String country) {
this.boatType = boatType;
this.sourceID = sourceID;
this.hullID = hullID;
this.shortName = shortName;
this.boatName = boatName;
this.country = country;
this.position = "-";
}
public String getBoatType() {
return boatType;
}
public Integer getSourceID() {
return sourceID;
}
public String getHullID() {
return hullID;
}
public String getShortName() {
return shortName;
}
public String getBoatName() {
return boatName;
}
public String getCountry() {
return country;
}
@@ -101,6 +111,9 @@ public class Yacht {
}
public void setLegNumber(Integer legNumber) {
if (colour != null && position != "-" && legNumber != this.legNumber&& RaceViewController.sparkLineStatus(sourceID)) {
RaceViewController.updateYachtPositionSparkline(this, legNumber);
}
this.legNumber = legNumber;
}