Action packets now sent at regular 20ms intervals

#issue[38] #implement
This commit is contained in:
Calum
2017-08-07 10:58:07 +12:00
parent 8a40119a98
commit a3ce5998ff
11 changed files with 23 additions and 24 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ public class Yacht {
private Integer legNumber = 0;
//SERVER SIDE
static public final Double TURN_STEP = 1.0; //This should be in some utils class somewhere 2bh. Public for tests sake.
public static final Double TURN_STEP = 1.0; //This should be in some utils class somewhere 2bh. Public for tests sake.
private Double lastHeading;
private Boolean sailIn;
private GeoPoint location;
@@ -32,8 +32,8 @@ import seng302.visualiser.fxObjects.BoatObject;
import seng302.visualiser.fxObjects.CourseBoundary;
import seng302.visualiser.fxObjects.Gate;
import seng302.visualiser.fxObjects.Marker;
import seng302.v.map.Boundary;
import seng302.v.map.CanvasMap;
import seng302.visualiser.map.Boundary;
import seng302.visualiser.map.CanvasMap;
/**
* Created by cir27 on 20/07/17.
@@ -135,7 +135,7 @@ public class GameView extends Pane {
}
}
// Platform.runLater(() ->
// boatObjects.forEach((boat, boatObject) -> boatObject.updateLocation())
boatObjects.forEach((boat, boatObject) -> boatObject.updateLocation());
// );
}
};
@@ -242,15 +242,15 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
}
});
// Adds the new data series to the sparkline (and set the colour of the series)
Platform.runLater(() -> {
Platform.runLater(() ->
sparkLineData
.stream()
.filter(spark -> !raceSparkLine.getData().contains(spark))
.forEach(spark -> {
raceSparkLine.getData().add(spark);
spark.getNode().lookup(".chart-series-line").setStyle("-fx-stroke:" + getBoatColorAsRGB(spark.getName()));
});
});
})
);
}
private void initialiseSparkLine() {
@@ -1,4 +1,4 @@
package seng302.v.map;
package seng302.visualiser.map;
/**
* The Boundary class represents a rectangle territorial boundary on a map. It
@@ -1,4 +1,4 @@
package seng302.v.map;
package seng302.visualiser.map;
import java.net.URL;
import javafx.geometry.Point2D;
@@ -1,4 +1,4 @@
package seng302.v.map;
package seng302.visualiser.map;
import javafx.geometry.Point2D;
import seng302.model.GeoPoint;
@@ -1,4 +1,4 @@
package seng302.v.map;
package seng302.visualiser.map;
import java.net.URL;
import java.util.ResourceBundle;
+1 -1
View File
@@ -3,7 +3,7 @@
<?import javafx.scene.canvas.Canvas?>
<?import javafx.scene.layout.Pane?>
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="960.0" prefWidth="1280.0" style="-fx-background-color: #ddd;" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng302.v.map.TestMapController">
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="960.0" prefWidth="1280.0" style="-fx-background-color: #ddd;" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng302.visualiser.map.TestMapController">
<children>
<Canvas fx:id="mapCanvas" height="960.0" width="1280.0" />
</children>
@@ -4,7 +4,6 @@ import static org.junit.Assert.assertEquals;
import org.junit.Test;
import seng302.model.GeoPoint;
import seng302.v.map.MercatorProjection;
/**
* Unit test for Mercator Project class.