Merged most recent master in, #story[1092]

main
Fan-Wu Yang 8 years ago
parent 7546c65893
commit 2e9c6fe593

@ -180,9 +180,9 @@ public class RaceLogic implements RunnableWithFramePeriod, Observer {
public void update(Observable o, Object arg) {
Collision e = (Collision)arg;
if(e.getBearing().degrees() == 0) System.out.println("Ahead");
else if(e.getBearing().degrees() < 90) System.out.println("Starboard");
else if(e.getBearing().degrees() > 270) System.out.println("Port");
else System.out.println("Behind");
// if(e.getBearing().degrees() == 0) System.out.println("Ahead");
// else if(e.getBearing().degrees() < 90) System.out.println("Starboard");
// else if(e.getBearing().degrees() > 270) System.out.println("Port");
// else System.out.println("Behind");
}
}

@ -64,8 +64,9 @@ public class CompoundMark extends XMLCompoundMark{
super();
setName(name);
setCompoundMarkID(id);
/*TODO need to talk to connor about this as Mark should be extending XMLMark
getMark().add(mark1);
if (mark2 != null) getMark().add(mark2);
if (mark2 != null) getMark().add(mark2);*/
this.id = id;
this.name = name;

@ -12,7 +12,7 @@ import mock.model.collider.Collision;
* Represents an individual mark.
* Has a source ID, name, and position.
*/
public class Mark extends Collider, XMLMark {
public class Mark extends Collider{
/**
* The source ID of the mark.
@ -42,11 +42,14 @@ public class Mark extends Collider, XMLMark {
*/
public Mark(int sourceID, String name, GPSCoordinate position) {
super();
/* TODO need to talk to connor about this as this class should be extending XMLMark
targetLat = position.getLatitude();
targetLng = position.getLongitude();
setSourceID(sourceID);
setName(name);
setName(name);*/
this.sourceID = sourceID;
this.name = name;
this.position = position;
}
@ -68,6 +71,14 @@ public class Mark extends Collider, XMLMark {
return name;
}
/**
* Returns the source ID of the mark
* @return the source ID of the mark
*/
public int getSourceID() {
return sourceID;
}
/**
* Returns the position of the mark.
* @return The position of the mark.

@ -8,6 +8,8 @@
package shared.xml.Race;
import mock.model.collider.Collider;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
@ -37,7 +39,7 @@ import javax.xml.bind.annotation.XmlType;
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
public class XMLMark {
public class XMLMark{
@XmlAttribute(name = "SeqId")
protected Integer seqId;

Loading…
Cancel
Save