Merge branch 'develop' into story1118_map_arrows

# Conflicts:
#	src/main/java/seng302/gameServer/GameState.java
#	src/main/java/seng302/gameServer/MainServerThread.java
#	src/main/java/seng302/model/RaceState.java
#	src/main/java/seng302/visualiser/GameClient.java
This commit is contained in:
Calum
2017-08-16 20:34:27 +12:00
19 changed files with 442 additions and 206 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);
}
}
@@ -21,9 +21,9 @@ public class BoatSailAnimationToggleTest {
@Test
public void sailToggleTest() throws Exception {
assertFalse(yacht.getSailIn());
yacht.toggleSail();
assertTrue(yacht.getSailIn());
yacht.toggleSail();
assertFalse(yacht.getSailIn());
}
}