mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Changed testUpdateYachtWithCollision to use MARK_COLLISION_DISTANCE
Changed testUpdateYachtWithCollision to use MARK_COLLISION_DISTANCE constant. #story[1117]
This commit is contained in:
@@ -33,7 +33,7 @@ public class Yacht {
|
||||
}
|
||||
|
||||
private static final Double ROUNDING_DISTANCE = 15d; // TODO: 3/08/17 wmu16 - Look into this value further
|
||||
private static final Double COLLISION_DISTANCE = ROUNDING_DISTANCE - 8d;
|
||||
public static final Double MARK_COLLISION_DISTANCE = ROUNDING_DISTANCE - 8d;
|
||||
private static final Double BOUNCE_FACTOR = 0.0001;
|
||||
private static final Integer COLLISION_UPDATE_INTERVAL = 100;
|
||||
|
||||
@@ -100,7 +100,7 @@ public class Yacht {
|
||||
Set<Mark> marksInRace = GameState.getMarks();
|
||||
|
||||
for (Mark mark : marksInRace){
|
||||
if (GeoUtility.getDistance(getLocation(), new GeoPoint(mark.getLat(), mark.getLng())) <= COLLISION_DISTANCE){
|
||||
if (GeoUtility.getDistance(getLocation(), new GeoPoint(mark.getLat(), mark.getLng())) <= MARK_COLLISION_DISTANCE){
|
||||
return mark;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,9 @@ public class UpdateYachtTest {
|
||||
|
||||
// Making sure no collision
|
||||
Double distance = GeoUtility.getDistance(yacht1.getLocation(), geoPoint2);
|
||||
Assert.assertTrue(distance > 10.0);
|
||||
|
||||
// Using mark collision distance as it will be smaller than boat collision distance
|
||||
Assert.assertTrue(distance > Yacht.MARK_COLLISION_DISTANCE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user