Improved boat bounce-back calculation

- Changed boat bounce back send the boat n meters in the opposite direction.
- Improved test to use the minimum of yacht and mark collision distances

Tags: #story[1117]
This commit is contained in:
Michael Rausch
2017-08-10 13:01:31 +12:00
parent b1598ccb0f
commit 07386ed2db
3 changed files with 23 additions and 33 deletions
@@ -50,8 +50,7 @@ public class UpdateYachtTest {
// Making sure no collision
Double distance = GeoUtility.getDistance(yacht1.getLocation(), geoPoint2);
// Using mark collision distance as it will be smaller than boat collision distance
Assert.assertTrue(distance > Yacht.MARK_COLLISION_DISTANCE);
Assert.assertTrue(distance > Math.min(Yacht.MARK_COLLISION_DISTANCE, Yacht.YACHT_COLLISION_DISTANCE));
}
}