Final commit for yacht refactor

tags: #story[1124] #pair[hyi25, wmu16]
This commit is contained in:
Haoming Yin
2017-08-15 14:49:16 +12:00
parent 2dc0ba07d9
commit c125708a4a
7 changed files with 76 additions and 75 deletions
@@ -20,15 +20,16 @@ import seng302.model.mark.CompoundMark;
* compared to the XMLParser boat class, also done outside Boat class because some old variables are
* not used anymore.
*/
public class Yacht extends Observable {
public class ClientYacht extends Observable {
@FunctionalInterface
public interface YachtLocationListener {
void notifyLocation(Yacht yacht, double lat, double lon, double heading, double velocity);
void notifyLocation(ClientYacht clientYacht, double lat, double lon, double heading,
double velocity);
}
private Logger logger = LoggerFactory.getLogger(Yacht.class);
private Logger logger = LoggerFactory.getLogger(ClientYacht.class);
//BOTH AFAIK
@@ -58,7 +59,7 @@ public class Yacht extends Observable {
private Integer positionInt = 0;
private Color colour;
public Yacht(String boatType, Integer sourceId, String hullID, String shortName,
public ClientYacht(String boatType, Integer sourceId, String hullID, String shortName,
String boatName, String country) {
this.boatType = boatType;
this.sourceId = sourceId;
+3 -5
View File
@@ -16,7 +16,7 @@ import seng302.utilities.GeoUtility;
*/
public class ServerYacht extends Observable {
private Logger logger = LoggerFactory.getLogger(Yacht.class);
private Logger logger = LoggerFactory.getLogger(ClientYacht.class);
public static final Double TURN_STEP = 5.0;
@@ -264,18 +264,16 @@ public class ServerYacht extends Observable {
return sourceId;
}
// TODO: 15/08/17 EXTREME BUG DO NOT DELETE THIS FUNCTION BREAKS PROGRAM IDK WHY ¯\_(ツ)_/¯
// TODO: 15/08/17 This method is implicitly called from the XML generator for boats DO NOT DELETE
public String getHullID() {
System.out.println("HullId");
if (hullID == null) {
return "";
}
return hullID;
}
// TODO: 15/08/17 EXTREME BUG DO NOT DELETE THIS FUNCTION BREAKS PROGRAM IDK WHY ¯\_(ツ)_/¯
// TODO: 15/08/17 This method is implicitly called from the XML generator for boats DO NOT DELETE
public String getShortName() {
System.out.println("shortName");
return shortName;
}