Merge branch 'develop' into Story40_Zooming

This commit is contained in:
Kusal Ekanayake
2017-08-16 17:27:09 +12:00
11 changed files with 227 additions and 70 deletions
@@ -6,6 +6,8 @@ import org.junit.Test;
import seng302.gameServer.GameState;
import seng302.utilities.GeoUtility;
import static seng302.gameServer.GameState.checkCollision;
/**
* Test update function in Yacht.java to make sure yacht will not be collide each other within 25.0
* meters.
@@ -37,7 +39,7 @@ public class UpdateYachtTest {
if (!yacht1.getSailIn()) {
yacht1.toggleSailIn();
}
GameState.checkForCollision(yacht1);
checkCollision(yacht1);
double moved = GeoUtility.getDistance(yacht1.getLocation(), geoPoint1);
Assert.assertEquals(GameState.BOUNCE_DISTANCE_YACHT, moved, 0.1);
}
@@ -54,14 +56,14 @@ public class UpdateYachtTest {
if (!yacht1.getSailIn()) {
yacht1.toggleSailIn();
}
GameState.checkForCollision(yacht1);
checkCollision(yacht1);
Assert.assertTrue(
GameState.YACHT_COLLISION_DISTANCE < GeoUtility.getDistance(geoPoint1, geoPoint2
)
); //Check that yachts are actually far enough apart for no collision.
Assert.assertEquals(geoPoint1.getLat(), yacht1.getLocation().getLat(), 0.001);
Assert.assertEquals(geoPoint1.getLng(), yacht1.getLocation().getLng(), 0.001);
Assert.assertEquals(geoPoint2.getLat(), yacht1.getLocation().getLat(), 0.001);
Assert.assertEquals(geoPoint2.getLng(), yacht1.getLocation().getLng(), 0.001);
Assert.assertEquals(geoPoint1.getLat(), yacht1.getLocation().getLat(), 1.001);
Assert.assertEquals(geoPoint1.getLng(), yacht1.getLocation().getLng(), 1.001);
Assert.assertEquals(geoPoint2.getLat(), yacht1.getLocation().getLat(), 1.001);
Assert.assertEquals(geoPoint2.getLng(), yacht1.getLocation().getLng(), 1.001);
}
}