Date formatting now supports both old and new formatting and dnf has been added to boat. #story[782]

main
Joseph Gardner 9 years ago
parent 2c414d3061
commit f0943d232a

@ -80,12 +80,15 @@ public class StreamedCourseXMLReader extends XMLReader {
private void readRace() throws ParseException {
DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
Element settings = (Element) doc.getElementsByTagName("Race").item(0);
NamedNodeMap raceTimeTag = doc.getElementsByTagName("RaceStartTime").item(0).getAttributes();
if (raceTimeTag.getNamedItem("Time") != null) dateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssZ");
System.out.println(getTextValueOfNode(settings, "CreationTimeDate"));
raceID = Integer.parseInt(getTextValueOfNode(settings, "RaceID"));
raceType = getTextValueOfNode(settings, "RaceType");
creationTimeDate = ZonedDateTime.parse(getTextValueOfNode(settings, "CreationTimeDate"), dateFormat);
NamedNodeMap raceTimeTag = doc.getElementsByTagName("RaceStartTime").item(0).getAttributes();
if (raceTimeTag.getNamedItem("Time") != null) raceStartTime = ZonedDateTime.parse(raceTimeTag.getNamedItem("Time").getTextContent(), dateFormat);
else raceStartTime = ZonedDateTime.parse(raceTimeTag.getNamedItem("Start").getTextContent(), dateFormat);
postpone = Boolean.parseBoolean(raceTimeTag.getNamedItem("Postpone").getTextContent());

@ -27,6 +27,7 @@ public class Boat {
protected long timeFinished;
protected StringProperty position;
protected boolean started = false;
protected boolean dnf = false;
private double wakeScale = 1 / 50;
private int sourceID;
@ -234,4 +235,12 @@ public class Boat {
public int getSourceID() {
return this.sourceID;
}
public boolean isDnf() {
return dnf;
}
public void setDnf(boolean dnf) {
this.dnf = dnf;
}
}

Loading…
Cancel
Save