Refactored the setup for MarkObjects (now renamed Markers) and made the CompoundMark + Mark + GeoPoint classes the standard across all classes instead of GateMark + SingleMark + Mark.

#refactor
This commit is contained in:
Calum
2017-07-31 02:19:19 +12:00
parent 6cae338c1e
commit f1ad03e913
32 changed files with 452 additions and 756 deletions
@@ -3,9 +3,9 @@ package seng302.model.stream.xml.parser;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import seng302.model.Corner;
import seng302.model.Limit;
import seng302.model.mark.Mark;
import seng302.model.mark.CompoundMark;
import seng302.model.mark.Corner;
/**
* Process a Document object containing race data in XML format and stores the data.
@@ -13,20 +13,18 @@ import seng302.model.mark.Mark;
public class RaceXMLData {
private List<Integer> participants;
private Map<Integer, Mark> compoundMarks;
private Map<Integer, CompoundMark> compoundMarks;
private List<Corner> markSequence;
private List<Limit> courseLimit;
private Map<Integer, Mark> individualMarks;
public RaceXMLData(List<Integer> participants, List<Mark> compoundMarks, List<Corner> markSequence,
List<Limit> courseLimit) {
public RaceXMLData(List<Integer> participants, List<CompoundMark> compoundMarks,
List<Corner> markSequence, List<Limit> courseLimit) {
this.participants = participants;
this.markSequence = markSequence;
this.courseLimit = courseLimit;
this.compoundMarks = new HashMap<>();
for (Mark mark : compoundMarks)
this.compoundMarks.put(mark.getId(), mark);
for (Mark mark : compoundMarks) {
for (CompoundMark cMark : compoundMarks) {
this.compoundMarks.put(cMark.getId(), cMark);
}
}
@@ -34,7 +32,7 @@ public class RaceXMLData {
return participants;
}
public Map<Integer, Mark> getCompoundMarks() {
public Map<Integer, CompoundMark> getCompoundMarks() {
return compoundMarks;
}
@@ -45,4 +43,5 @@ public class RaceXMLData {
public List<Limit> getCourseLimit() {
return courseLimit;
}
}