Linked the streamedRace course to the visualiser, linked the boats to the visualiser (this needs to be tests) #story[768]
parent
073102d1a3
commit
033198ca2c
@ -1,44 +1,60 @@
|
|||||||
package seng302.Mock;
|
package seng302.Mock;
|
||||||
|
|
||||||
import javafx.scene.paint.Color;
|
import javafx.scene.paint.Color;
|
||||||
|
import org.geotools.referencing.GeodeticCalculator;
|
||||||
import seng302.GPSCoordinate;
|
import seng302.GPSCoordinate;
|
||||||
import seng302.Model.Boat;
|
import seng302.Model.Boat;
|
||||||
import seng302.Model.BoatInRace;
|
import seng302.Model.BoatInRace;
|
||||||
|
import seng302.Model.Leg;
|
||||||
|
import seng302.Model.Marker;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Joseph on 24/04/2017.
|
* Created by Joseph on 24/04/2017.
|
||||||
*/
|
*/
|
||||||
public class StreamedBoat extends BoatInRace {
|
public class StreamedBoat extends BoatInRace {
|
||||||
private int sourceID;
|
private int sourceID;
|
||||||
private boolean complete;
|
private boolean dnf = false;
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
this.velocity = 0;
|
||||||
|
this.scaledVelocity = 0;
|
||||||
|
this.heading = 0;
|
||||||
|
this.setCurrentLeg(new Leg("None", -1));
|
||||||
|
this.setCurrentPosition(new GPSCoordinate(0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
public StreamedBoat(int sourceID, String name, Color colour, String abbrev) {
|
public StreamedBoat(int sourceID, String name, Color colour, String abbrev) {
|
||||||
super(name, colour, abbrev);
|
super(name, colour, abbrev);
|
||||||
this.sourceID = sourceID;
|
this.sourceID = sourceID;
|
||||||
this.complete = true;
|
this.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public StreamedBoat(int sourceID) {
|
public StreamedBoat(int sourceID) {
|
||||||
super("None", Color.BLACK, "None");
|
super("None", Color.BLACK, "None");
|
||||||
this.sourceID = sourceID;
|
this.sourceID = sourceID;
|
||||||
this.complete = false;
|
this.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overridden to ignore this function
|
* Calculates the azimuth of the travel via heading of the boat
|
||||||
* @deprecated
|
*
|
||||||
* @return 0
|
* @return the direction that the boat is heading towards in degrees (-180 to 180).
|
||||||
*/
|
*/
|
||||||
public double getScaledVelocity() {
|
public double calculateAzimuth() {
|
||||||
return 0;
|
double azimuth;
|
||||||
|
if (heading <= 180) {
|
||||||
|
azimuth = heading;
|
||||||
|
} else {
|
||||||
|
azimuth = -heading + 180;
|
||||||
|
}
|
||||||
|
return azimuth;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public boolean isDnf() {
|
||||||
* Overridden to ignore this function
|
return dnf;
|
||||||
* @deprecated
|
}
|
||||||
* @param velocity of boat
|
|
||||||
*/
|
public void setDnf(boolean dnf) {
|
||||||
public void setScaledVelocity(double velocity) {
|
this.dnf = dnf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in new issue