diff --git a/racevisionGame/src/main/java/mock/app/Event.java b/racevisionGame/src/main/java/mock/app/Event.java index c94a691f..631f431d 100644 --- a/racevisionGame/src/main/java/mock/app/Event.java +++ b/racevisionGame/src/main/java/mock/app/Event.java @@ -3,6 +3,8 @@ package mock.app; import mock.dataInput.PolarParser; import mock.model.MockRace; import mock.model.Polars; +import mock.xml.Race; +import mock.xml.RaceFactory; import network.Messages.LatestMessages; import shared.dataInput.*; import shared.enums.XMLFileType; @@ -10,10 +12,15 @@ import shared.exceptions.InvalidBoatDataException; import shared.exceptions.InvalidRaceDataException; import shared.exceptions.InvalidRegattaDataException; import shared.exceptions.XMLReaderException; +import shared.model.CompoundMark; import shared.model.Constants; +import shared.model.Corner; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; import javax.xml.transform.TransformerException; -import java.io.IOException; +import java.io.*; import java.net.UnknownHostException; import java.nio.charset.StandardCharsets; import java.time.ZonedDateTime; @@ -42,7 +49,7 @@ public class Event { */ private Event() { try { - this.raceXML = getRaceXMLAtCurrentTime(XMLReader.readXMLFileToString("mock/mockXML/raceTest.xml", StandardCharsets.UTF_8)); + this.raceXML = getRaceXMLAtCurrentTime(alterRaceToWind("mock/mockXML/raceSchemaTest.xml", 0)); this.boatXML = XMLReader.readXMLFileToString("mock/mockXML/boatsSinglePlayer.xml", StandardCharsets.UTF_8); this.regattaXML = XMLReader.readXMLFileToString("mock/mockXML/regattaTest.xml", StandardCharsets.UTF_8); this.xmlFileType = XMLFileType.Contents; @@ -58,6 +65,10 @@ public class Event { e.printStackTrace(); } catch (TransformerException e) { e.printStackTrace(); + } catch (InvalidRaceDataException e) { + e.printStackTrace(); + } catch (JAXBException e) { + e.printStackTrace(); } } @@ -130,4 +141,94 @@ public class Event { return raceXML; } + + + private Race copyRace(RaceXMLReader reader) throws InvalidRaceDataException, XMLReaderException { + mock.xml.RaceFactory raceFactory = new RaceFactory(); + mock.xml.Race race = raceFactory.createRace(); + race.setRaceID(String.valueOf(reader.getRaceId())); + race.setRaceType(String.valueOf(reader.getRaceType())); + race.setCreationTimeDate("CREATION_TIME");//this needs to be changed later + + //Race Start Time + mock.xml.Race.RaceStartTime raceStartTime = raceFactory.createRaceRaceStartTime(); + raceStartTime.setPostpone("false"); + raceStartTime.setTime("START_TIME");//this needs to be changed later + race.setRaceStartTime(raceStartTime); + + //Participants + Race.Participants participants = raceFactory.createRaceParticipants(); + for (int i :reader.getParticipants()) { + Race.Participants.Yacht yacht = raceFactory.createRaceParticipantsYacht(); + yacht.setSourceID(String.valueOf(i)); + participants.getYacht().add(yacht); //java schema does not clone the array so this is "safe". + } + race.setParticipants(participants); + + //compound marks sequence + Race.CompoundMarkSequence cms = raceFactory.createRaceCompoundMarkSequence(); + for (Corner mark: reader.getCornersList()){ + Race.CompoundMarkSequence.Corner corner = raceFactory.createRaceCompoundMarkSequenceCorner(); + corner.setCompoundMarkID(String.valueOf(mark.getId())); + corner.setSeqID(String.valueOf(mark.getSeqID())); + cms.getCorner().add(corner); + } + race.setCompoundMarkSequence(cms); + + //Course + Race.Course course = raceFactory.createRaceCourse(); + for (CompoundMark mark: reader.getCompoundMarks()){ + Race.Course.CompoundMark cm = raceFactory.createRaceCourseCompoundMark(); + cm.setName(mark.getName()); + cm.setCompoundMarkID(String.valueOf(mark.getId())); + if (mark.getMark1() != null){ + Race.Course.CompoundMark.Mark m1 = raceFactory.createRaceCourseCompoundMarkMark(); + m1.setName(mark.getMark1().getName()); + m1.setTargetLat(String.valueOf(mark.getMark1().getPosition().getLatitude())); + m1.setTargetLng(String.valueOf(mark.getMark1().getPosition().getLongitude())); + m1.setSourceID(String.valueOf(mark.getMark1().getSourceID())); + cm.getMark().add(m1); + } + //make this not copy paste later but just need the concept working right now + if (mark.getMark2() != null){ + Race.Course.CompoundMark.Mark m2 = raceFactory.createRaceCourseCompoundMarkMark(); + m2.setName(mark.getMark1().getName()); + m2.setTargetLat(String.valueOf(mark.getMark1().getPosition().getLatitude())); + m2.setTargetLng(String.valueOf(mark.getMark1().getPosition().getLongitude())); + m2.setSourceID(String.valueOf(mark.getMark1().getSourceID())); + cm.getMark().add(m2); + } + course.getCompoundMark().add(cm); + } + race.setCourse(course); + + //Course Limit + Race.CourseLimit courseLimit = raceFactory.createRaceCourseLimit(); + for (int i = 0; i < reader.getBoundary().size(); i++){ + Race.CourseLimit.Limit limit = raceFactory.createRaceCourseLimitLimit(); + limit.setSeqID(String.valueOf(i+1)); + limit.setLat(String.valueOf(reader.getBoundary().get(i).getLatitude())); + limit.setLon(String.valueOf(reader.getBoundary().get(i).getLongitude())); + courseLimit.getLimit().add(limit); + } + race.setCourseLimit(courseLimit); + + return race; + } + + private String alterRaceToWind(String s, double degrees) throws XMLReaderException, InvalidRaceDataException, JAXBException { + RaceXMLReader reader = new RaceXMLReader(s, XMLFileType.ResourcePath); + + mock.xml.Race race = copyRace(reader); + + JAXBContext context = JAXBContext.newInstance(mock.xml.Race.class); + Marshaller jaxbMarshaller = context.createMarshaller(); + jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); + + StringWriter sw = new StringWriter(); + + jaxbMarshaller.marshal(race, sw); + return sw.toString(); + } + } diff --git a/racevisionGame/src/main/java/mock/xml/ObjectFactory.java b/racevisionGame/src/main/java/mock/xml/ObjectFactory.java new file mode 100644 index 00000000..46d95ee5 --- /dev/null +++ b/racevisionGame/src/main/java/mock/xml/ObjectFactory.java @@ -0,0 +1,127 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2017.08.03 at 02:28:57 AM NZST +// + + +package mock.xml; + +import javax.xml.bind.annotation.XmlRegistry; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the race package. + *
An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: race + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link Race } + * + */ + public Race createRace() { + return new Race(); + } + + /** + * Create an instance of {@link Race.CourseLimit } + * + */ + public Race.CourseLimit createRaceCourseLimit() { + return new Race.CourseLimit(); + } + + /** + * Create an instance of {@link Race.Course } + * + */ + public Race.Course createRaceCourse() { + return new Race.Course(); + } + + /** + * Create an instance of {@link Race.Course.CompoundMark } + * + */ + public Race.Course.CompoundMark createRaceCourseCompoundMark() { + return new Race.Course.CompoundMark(); + } + + /** + * Create an instance of {@link Race.CompoundMarkSequence } + * + */ + public Race.CompoundMarkSequence createRaceCompoundMarkSequence() { + return new Race.CompoundMarkSequence(); + } + + /** + * Create an instance of {@link Race.Participants } + * + */ + public Race.Participants createRaceParticipants() { + return new Race.Participants(); + } + + /** + * Create an instance of {@link Race.RaceStartTime } + * + */ + public Race.RaceStartTime createRaceRaceStartTime() { + return new Race.RaceStartTime(); + } + + /** + * Create an instance of {@link Race.CourseLimit.Limit } + * + */ + public Race.CourseLimit.Limit createRaceCourseLimitLimit() { + return new Race.CourseLimit.Limit(); + } + + /** + * Create an instance of {@link Race.Course.CompoundMark.Mark } + * + */ + public Race.Course.CompoundMark.Mark createRaceCourseCompoundMarkMark() { + return new Race.Course.CompoundMark.Mark(); + } + + /** + * Create an instance of {@link Race.CompoundMarkSequence.Corner } + * + */ + public Race.CompoundMarkSequence.Corner createRaceCompoundMarkSequenceCorner() { + return new Race.CompoundMarkSequence.Corner(); + } + + /** + * Create an instance of {@link Race.Participants.Yacht } + * + */ + public Race.Participants.Yacht createRaceParticipantsYacht() { + return new Race.Participants.Yacht(); + } + +} diff --git a/racevisionGame/src/main/java/mock/xml/Race.java b/racevisionGame/src/main/java/mock/xml/Race.java new file mode 100644 index 00000000..e2f1837d --- /dev/null +++ b/racevisionGame/src/main/java/mock/xml/Race.java @@ -0,0 +1,1258 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2017.08.03 at 02:28:57 AM NZST +// + + +package mock.xml; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *
Java class for anonymous complex type. + * + *
The following schema fragment specifies the expected content contained within this class. + * + *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="RaceID" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="RaceType" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="CreationTimeDate" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="RaceStartTime">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * <element name="Participants">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Yacht" maxOccurs="unbounded">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * <element name="CompoundMarkSequence">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Corner" maxOccurs="unbounded">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * <element name="Course">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="CompoundMark" maxOccurs="unbounded">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Mark" maxOccurs="unbounded">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * <element name="CourseLimit">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Limit" maxOccurs="unbounded">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "raceID",
+ "raceType",
+ "creationTimeDate",
+ "raceStartTime",
+ "participants",
+ "compoundMarkSequence",
+ "course",
+ "courseLimit"
+})
+@XmlRootElement(name = "Race")
+public class Race {
+
+ @XmlElement(name = "RaceID", required = true)
+ protected String raceID;
+ @XmlElement(name = "RaceType", required = true)
+ protected String raceType;
+ @XmlElement(name = "CreationTimeDate", required = true)
+ protected String creationTimeDate;
+ @XmlElement(name = "RaceStartTime", required = true)
+ protected Race.RaceStartTime raceStartTime;
+ @XmlElement(name = "Participants", required = true)
+ protected Race.Participants participants;
+ @XmlElement(name = "CompoundMarkSequence", required = true)
+ protected Race.CompoundMarkSequence compoundMarkSequence;
+ @XmlElement(name = "Course", required = true)
+ protected Race.Course course;
+ @XmlElement(name = "CourseLimit", required = true)
+ protected Race.CourseLimit courseLimit;
+
+ /**
+ * Gets the value of the raceID property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getRaceID() {
+ return raceID;
+ }
+
+ /**
+ * Sets the value of the raceID property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setRaceID(String value) {
+ this.raceID = value;
+ }
+
+ /**
+ * Gets the value of the raceType property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getRaceType() {
+ return raceType;
+ }
+
+ /**
+ * Sets the value of the raceType property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setRaceType(String value) {
+ this.raceType = value;
+ }
+
+ /**
+ * Gets the value of the creationTimeDate property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCreationTimeDate() {
+ return creationTimeDate;
+ }
+
+ /**
+ * Sets the value of the creationTimeDate property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCreationTimeDate(String value) {
+ this.creationTimeDate = value;
+ }
+
+ /**
+ * Gets the value of the raceStartTime property.
+ *
+ * @return
+ * possible object is
+ * {@link Race.RaceStartTime }
+ *
+ */
+ public Race.RaceStartTime getRaceStartTime() {
+ return raceStartTime;
+ }
+
+ /**
+ * Sets the value of the raceStartTime property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Race.RaceStartTime }
+ *
+ */
+ public void setRaceStartTime(Race.RaceStartTime value) {
+ this.raceStartTime = value;
+ }
+
+ /**
+ * Gets the value of the participants property.
+ *
+ * @return
+ * possible object is
+ * {@link Race.Participants }
+ *
+ */
+ public Race.Participants getParticipants() {
+ return participants;
+ }
+
+ /**
+ * Sets the value of the participants property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Race.Participants }
+ *
+ */
+ public void setParticipants(Race.Participants value) {
+ this.participants = value;
+ }
+
+ /**
+ * Gets the value of the compoundMarkSequence property.
+ *
+ * @return
+ * possible object is
+ * {@link Race.CompoundMarkSequence }
+ *
+ */
+ public Race.CompoundMarkSequence getCompoundMarkSequence() {
+ return compoundMarkSequence;
+ }
+
+ /**
+ * Sets the value of the compoundMarkSequence property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Race.CompoundMarkSequence }
+ *
+ */
+ public void setCompoundMarkSequence(Race.CompoundMarkSequence value) {
+ this.compoundMarkSequence = value;
+ }
+
+ /**
+ * Gets the value of the course property.
+ *
+ * @return
+ * possible object is
+ * {@link Race.Course }
+ *
+ */
+ public Race.Course getCourse() {
+ return course;
+ }
+
+ /**
+ * Sets the value of the course property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Race.Course }
+ *
+ */
+ public void setCourse(Race.Course value) {
+ this.course = value;
+ }
+
+ /**
+ * Gets the value of the courseLimit property.
+ *
+ * @return
+ * possible object is
+ * {@link Race.CourseLimit }
+ *
+ */
+ public Race.CourseLimit getCourseLimit() {
+ return courseLimit;
+ }
+
+ /**
+ * Sets the value of the courseLimit property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Race.CourseLimit }
+ *
+ */
+ public void setCourseLimit(Race.CourseLimit value) {
+ this.courseLimit = value;
+ }
+
+
+ /**
+ * Java class for anonymous complex type. + * + *
The following schema fragment specifies the expected content contained within this class. + * + *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Corner" maxOccurs="unbounded">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "corner"
+ })
+ public static class CompoundMarkSequence {
+
+ @XmlElement(name = "Corner", required = true)
+ protected List
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a set method for the corner property.
+ *
+ *
+ * For example, to add a new item, do as follows: + *
+ * getCorner().add(newItem); + *+ * + * + *
+ * Objects of the following type(s) are allowed in the list
+ * {@link Race.CompoundMarkSequence.Corner }
+ *
+ *
+ */
+ public List Java class for anonymous complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * Java class for anonymous complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ *
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a
+ * For example, to add a new item, do as follows:
+ *
+ * Objects of the following type(s) are allowed in the list
+ * {@link Race.Course.CompoundMark }
+ *
+ *
+ */
+ public List Java class for anonymous complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ *
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a
+ * For example, to add a new item, do as follows:
+ *
+ * Objects of the following type(s) are allowed in the list
+ * {@link Race.Course.CompoundMark.Mark }
+ *
+ *
+ */
+ public List Java class for anonymous complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * Java class for anonymous complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ *
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a
+ * For example, to add a new item, do as follows:
+ *
+ * Objects of the following type(s) are allowed in the list
+ * {@link Race.CourseLimit.Limit }
+ *
+ *
+ */
+ public List Java class for anonymous complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * Java class for anonymous complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ *
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a
+ * For example, to add a new item, do as follows:
+ *
+ * Objects of the following type(s) are allowed in the list
+ * {@link Race.Participants.Yacht }
+ *
+ *
+ */
+ public List Java class for anonymous complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * Java class for anonymous complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class RaceFactory {
+
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: main.java.mock.xml
+ *
+ */
+ public RaceFactory() {
+ }
+
+ /**
+ * Create an instance of {@link Race }
+ *
+ */
+ public Race createRace() {
+ return new Race();
+ }
+
+ /**
+ * Create an instance of {@link Race.CourseLimit }
+ *
+ */
+ public Race.CourseLimit createRaceCourseLimit() {
+ return new Race.CourseLimit();
+ }
+
+ /**
+ * Create an instance of {@link Race.Course }
+ *
+ */
+ public Race.Course createRaceCourse() {
+ return new Race.Course();
+ }
+
+ /**
+ * Create an instance of {@link Race.Course.CompoundMark }
+ *
+ */
+ public Race.Course.CompoundMark createRaceCourseCompoundMark() {
+ return new Race.Course.CompoundMark();
+ }
+
+ /**
+ * Create an instance of {@link Race.CompoundMarkSequence }
+ *
+ */
+ public Race.CompoundMarkSequence createRaceCompoundMarkSequence() {
+ return new Race.CompoundMarkSequence();
+ }
+
+ /**
+ * Create an instance of {@link Race.Participants }
+ *
+ */
+ public Race.Participants createRaceParticipants() {
+ return new Race.Participants();
+ }
+
+ /**
+ * Create an instance of {@link Race.RaceStartTime }
+ *
+ */
+ public Race.RaceStartTime createRaceRaceStartTime() {
+ return new Race.RaceStartTime();
+ }
+
+ /**
+ * Create an instance of {@link Race.CourseLimit.Limit }
+ *
+ */
+ public Race.CourseLimit.Limit createRaceCourseLimitLimit() {
+ return new Race.CourseLimit.Limit();
+ }
+
+ /**
+ * Create an instance of {@link Race.Course.CompoundMark.Mark }
+ *
+ */
+ public Race.Course.CompoundMark.Mark createRaceCourseCompoundMarkMark() {
+ return new Race.Course.CompoundMark.Mark();
+ }
+
+ /**
+ * Create an instance of {@link Race.CompoundMarkSequence.Corner }
+ *
+ */
+ public Race.CompoundMarkSequence.Corner createRaceCompoundMarkSequenceCorner() {
+ return new Race.CompoundMarkSequence.Corner();
+ }
+
+ /**
+ * Create an instance of {@link Race.Participants.Yacht }
+ *
+ */
+ public Race.Participants.Yacht createRaceParticipantsYacht() {
+ return new Race.Participants.Yacht();
+ }
+
+}
diff --git a/racevisionGame/src/main/java/shared/dataInput/RaceXMLReader.java b/racevisionGame/src/main/java/shared/dataInput/RaceXMLReader.java
index 7e61b3de..361fefd4 100644
--- a/racevisionGame/src/main/java/shared/dataInput/RaceXMLReader.java
+++ b/racevisionGame/src/main/java/shared/dataInput/RaceXMLReader.java
@@ -51,6 +51,10 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
*/
private final List
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "")
+ public static class Corner {
+
+ @XmlAttribute(name = "CompoundMarkID", required = true)
+ protected String compoundMarkID;
+ @XmlAttribute(name = "SeqID", required = true)
+ protected String seqID;
+
+ /**
+ * Gets the value of the compoundMarkID property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCompoundMarkID() {
+ return compoundMarkID;
+ }
+
+ /**
+ * Sets the value of the compoundMarkID property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCompoundMarkID(String value) {
+ this.compoundMarkID = value;
+ }
+
+ /**
+ * Gets the value of the seqID property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSeqID() {
+ return seqID;
+ }
+
+ /**
+ * Sets the value of the seqID property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSeqID(String value) {
+ this.seqID = value;
+ }
+
+ }
+
+ }
+
+
+ /**
+ *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="CompoundMark" maxOccurs="unbounded">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Mark" maxOccurs="unbounded">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "compoundMark"
+ })
+ public static class Course {
+
+ @XmlElement(name = "CompoundMark", required = true)
+ protected Listset method for the compoundMark property.
+ *
+ *
+ * getCompoundMark().add(newItem);
+ *
+ *
+ *
+ *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Mark" maxOccurs="unbounded">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "mark"
+ })
+ public static class CompoundMark {
+
+ @XmlElement(name = "Mark", required = true)
+ protected Listset method for the mark property.
+ *
+ *
+ * getMark().add(newItem);
+ *
+ *
+ *
+ *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "")
+ public static class Mark {
+
+ @XmlAttribute(name = "SeqId")
+ protected String seqId;
+ @XmlAttribute(name = "Name", required = true)
+ protected String name;
+ @XmlAttribute(name = "TargetLat", required = true)
+ protected String targetLat;
+ @XmlAttribute(name = "TargetLng", required = true)
+ protected String targetLng;
+ @XmlAttribute(name = "SourceID", required = true)
+ protected String sourceID;
+
+ /**
+ * Gets the value of the seqId property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSeqId() {
+ return seqId;
+ }
+
+ /**
+ * Sets the value of the seqId property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSeqId(String value) {
+ this.seqId = value;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the targetLat property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTargetLat() {
+ return targetLat;
+ }
+
+ /**
+ * Sets the value of the targetLat property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTargetLat(String value) {
+ this.targetLat = value;
+ }
+
+ /**
+ * Gets the value of the targetLng property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTargetLng() {
+ return targetLng;
+ }
+
+ /**
+ * Sets the value of the targetLng property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTargetLng(String value) {
+ this.targetLng = value;
+ }
+
+ /**
+ * Gets the value of the sourceID property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSourceID() {
+ return sourceID;
+ }
+
+ /**
+ * Sets the value of the sourceID property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSourceID(String value) {
+ this.sourceID = value;
+ }
+
+ }
+
+ }
+
+ }
+
+
+ /**
+ *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Limit" maxOccurs="unbounded">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "limit"
+ })
+ public static class CourseLimit {
+
+ @XmlElement(name = "Limit", required = true)
+ protected Listset method for the limit property.
+ *
+ *
+ * getLimit().add(newItem);
+ *
+ *
+ *
+ *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "")
+ public static class Limit {
+
+ @XmlAttribute(name = "Lat", required = true)
+ protected String lat;
+ @XmlAttribute(name = "Lon", required = true)
+ protected String lon;
+ @XmlAttribute(name = "SeqID", required = true)
+ protected String seqID;
+
+ /**
+ * Gets the value of the lat property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getLat() {
+ return lat;
+ }
+
+ /**
+ * Sets the value of the lat property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setLat(String value) {
+ this.lat = value;
+ }
+
+ /**
+ * Gets the value of the lon property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getLon() {
+ return lon;
+ }
+
+ /**
+ * Sets the value of the lon property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setLon(String value) {
+ this.lon = value;
+ }
+
+ /**
+ * Gets the value of the seqID property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSeqID() {
+ return seqID;
+ }
+
+ /**
+ * Sets the value of the seqID property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSeqID(String value) {
+ this.seqID = value;
+ }
+
+ }
+
+ }
+
+
+ /**
+ *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Yacht" maxOccurs="unbounded">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "yacht"
+ })
+ public static class Participants {
+
+ @XmlElement(name = "Yacht", required = true)
+ protected Listset method for the yacht property.
+ *
+ *
+ * getYacht().add(newItem);
+ *
+ *
+ *
+ *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "")
+ public static class Yacht {
+
+ @XmlAttribute(name = "SourceID", required = true)
+ protected String sourceID;
+
+ /**
+ * Gets the value of the sourceID property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSourceID() {
+ return sourceID;
+ }
+
+ /**
+ * Sets the value of the sourceID property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSourceID(String value) {
+ this.sourceID = value;
+ }
+
+ }
+
+ }
+
+
+ /**
+ *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "")
+ public static class RaceStartTime {
+
+ @XmlAttribute(name = "Postpone", required = true)
+ protected String postpone;
+ @XmlAttribute(name = "Time", required = true)
+ protected String time;
+
+ /**
+ * Gets the value of the postpone property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getPostpone() {
+ return postpone;
+ }
+
+ /**
+ * Sets the value of the postpone property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setPostpone(String value) {
+ this.postpone = value;
+ }
+
+ /**
+ * Gets the value of the time property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTime() {
+ return time;
+ }
+
+ /**
+ * Sets the value of the time property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTime(String value) {
+ this.time = value;
+ }
+
+ }
+
+}
diff --git a/racevisionGame/src/main/java/mock/xml/RaceFactory.java b/racevisionGame/src/main/java/mock/xml/RaceFactory.java
new file mode 100644
index 00000000..674fa849
--- /dev/null
+++ b/racevisionGame/src/main/java/mock/xml/RaceFactory.java
@@ -0,0 +1,127 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
+// See http://java.sun.com/xml/jaxb
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2017.08.03 at 01:07:33 AM NZST
+//
+
+
+package mock.xml;
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the main.java.mock.xml package.
+ *