WIP: Implemented basic mark rounding algorithm.

Removed RacePosition class. Instead marks are just grabbed from the mark order class when necessary.
No marks are stored as an attribute in the yacht class but the 'currentMarkSeqID' which is used to get current, and surrounding marks.
Works for all marks in between but not including starting and finishing gate as no angle can be made with them. Still to work out how to implement this

 #story[1124]
This commit is contained in:
William Muir
2017-08-07 00:23:54 +12:00
parent 43788bd153
commit 7f0329dda6
6 changed files with 148 additions and 159 deletions
+10 -8
View File
@@ -38,17 +38,19 @@ public class YachtTest {
Mark subMark2 = new Mark("H", 57.670822, 11.843392, 0);
compoundMark.addSubMarks(subMark1, subMark2);
yacht.setNextMark(compoundMark);
}
@Test
public void testDistanceToNextMark() {
Double actual, expected;
actual = yacht.calcDistanceToNextMark();
expected = 927d;
assertEquals(expected, actual, expected * toleranceRatio);
}
//This will no longer work as we cant set the next mark any more as we no longer hold it in
//yacht class as an attribute
// @Test
// public void testDistanceToNextMark() {
// Double actual, expected;
// actual = yacht.calcDistanceToNextMark();
// expected = 927d;
// assertEquals(expected, actual, expected * toleranceRatio);
// }
}