Merge branch 'Story71_TackAndGybeSmoothly' into 'develop'

Story 71 Tack/Gybe, Story 65 VMG Autopilot

# Implementation
- Added autopilot functionality to move boat towards a given heading with a single function call.
- Added functionality to move boat from one side of the wind to the other (tack/gybe) with a single button press.
- Added functionality to move boat to correct VMG from polars with single button press.
- Pressing a button a second time will disable the autopilot, as will pressing the Upwind/Downwind keys.

# Testing
- Fairly simple JUnit testing for a set of beginning headings and expected ends for the autopilot
- Unsure how cucumber testing would actually be better than simple junit testing in this case.

See merge request !55
This commit is contained in:
Zhi You Tan
2017-08-13 14:22:28 +12:00
9 changed files with 223 additions and 61 deletions
@@ -8,10 +8,10 @@ import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import seng302.model.mark.CompoundMark;
import seng302.gameServer.server.simulator.Corner;
import seng302.model.mark.Mark;
import seng302.gameServer.server.simulator.RoundingType;
import seng302.model.mark.CompoundMark;
import seng302.model.mark.Mark;
/**
* Parses the race xml file to get course details
@@ -84,17 +84,17 @@ public class CourseParser extends FileParser {
NodeList marks = e.getElementsByTagName("Mark");
List<Mark> subMarks = new ArrayList<>();
for (int i = 0; i < marks.getLength(); i++) {
Mark mark = getMark(marks.item(i));
Mark mark = getMark(marks.item(i));
if (mark != null) {
subMarks.add(mark);
}
}
}
return new CompoundMark(markID, name, subMarks);
}
System.out.println("Failed to create compound mark.");
return null;
}
System.out.println("Failed to create compound mark.");
return null;
}
private Mark getMark(Node node) {