Changed it so Boat can be used as a superclass for StreamedBoat and BoatInRace properly and removed ConstantVelocityRace. Everything that used to use BoatInRace or StreamedBoat now uses it superclass (boat). #pair[jjg64, cbt24] #refactor #story[782]
This commit is contained in:
@@ -11,26 +11,22 @@ import seng302.Model.Marker;
|
||||
/**
|
||||
* Created by Joseph on 24/04/2017.
|
||||
*/
|
||||
public class StreamedBoat extends BoatInRace {
|
||||
public class StreamedBoat extends Boat {
|
||||
private int sourceID;
|
||||
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) {
|
||||
super(name, colour, abbrev);
|
||||
super(name, abbrev);
|
||||
this.sourceID = sourceID;
|
||||
this.init();
|
||||
}
|
||||
|
||||
public StreamedBoat(int sourceID) {
|
||||
super("None", Color.BLACK, "None");
|
||||
super("None", "None");
|
||||
this.sourceID = sourceID;
|
||||
this.init();
|
||||
}
|
||||
@@ -49,12 +45,4 @@ public class StreamedBoat extends BoatInRace {
|
||||
}
|
||||
return azimuth;
|
||||
}
|
||||
|
||||
public boolean isDnf() {
|
||||
return dnf;
|
||||
}
|
||||
|
||||
public void setDnf(boolean dnf) {
|
||||
this.dnf = dnf;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user