mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
WIP: Second commit for seperating server and client yacht classes
tags: #story[1124]
This commit is contained in:
@@ -8,12 +8,12 @@ import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import seng302.gameServer.GameState;
|
||||
import seng302.model.PolarTable;
|
||||
import seng302.model.Yacht;
|
||||
import seng302.model.ServerYacht;
|
||||
|
||||
|
||||
public class YachtTest {
|
||||
|
||||
private static Yacht y1;
|
||||
private static ServerYacht y1;
|
||||
//Yacht y2;
|
||||
private static Double windDirection = 180d;
|
||||
private static Double windSpeed = 20d;
|
||||
@@ -21,7 +21,7 @@ public class YachtTest {
|
||||
|
||||
@BeforeClass
|
||||
public static void setUp() {
|
||||
y1 = new Yacht("Yacht", 101, "Y1", "Y1", "Yacht 1", "C1");
|
||||
y1 = new ServerYacht("Yacht", 101, "Y1", "Y1", "Yacht 1", "C1");
|
||||
gs = new GameState("localhost");
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import seng302.gameServer.GameState;
|
||||
import seng302.gameServer.MainServerThread;
|
||||
import seng302.gameServer.server.messages.BoatAction;
|
||||
import seng302.model.ServerYacht;
|
||||
import seng302.model.Yacht;
|
||||
import seng302.visualiser.ClientToServerThread;
|
||||
|
||||
/**
|
||||
@@ -46,7 +45,8 @@ public class RegularPacketsTest {
|
||||
long endTime = System.currentTimeMillis();
|
||||
SleepThreadMaxDelay();
|
||||
//Allowed to be two loops of delay due to loop delay and processing delay at client + server ends.
|
||||
Assert.assertEquals(TEST_DISTANCE / Yacht.TURN_STEP * ClientToServerThread.PACKET_SENDING_INTERVAL_MS,
|
||||
Assert.assertEquals(
|
||||
TEST_DISTANCE / ServerYacht.TURN_STEP * ClientToServerThread.PACKET_SENDING_INTERVAL_MS,
|
||||
(endTime - startTime), 2 * ClientToServerThread.PACKET_SENDING_INTERVAL_MS);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user