Fixed the bug that boats could round over a gate but still "across" it. Added unit test to ensure the algorithm works.

tags: #story[1124]
This commit is contained in:
Haoming Yin
2017-08-08 10:42:36 +12:00
parent 4375b73257
commit ed0a783374
3 changed files with 43 additions and 37 deletions
+1 -1
View File
@@ -177,7 +177,7 @@ public class Yacht {
if (GameState.getMarkOrder().isLastMark(currentMarkSeqID) || currentMarkSeqID == 0) {
if (GeoUtility.checkCrossedLine(currentMark.getSubMark(1),
currentMark.getSubMark(2), lastLocation, location)) {
currentMark.getSubMark(2), lastLocation, location) > 0) {
System.out.println(
"(" + currentMarkSeqID + ") Passed gate: " + currentMark.getMarks().get(0)
.getName()