Merge remote-tracking branch 'remotes/origin/master' into story77
# Conflicts: # racevisionGame/src/main/java/mock/app/Event.java # racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java # racevisionGame/src/main/java/visualiser/Controllers/HostGameController.java # racevisionGame/src/main/java/visualiser/Controllers/LobbyController.java # racevisionGame/src/main/java/visualiser/Controllers/TitleController.java # racevisionGame/src/main/java/visualiser/app/App.java # settings/keyBindings.xml
This commit is contained in:
@@ -11,8 +11,6 @@ import mock.exceptions.EventConstructionException;
|
||||
import visualiser.app.App;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.DatagramSocket;
|
||||
import java.net.Socket;
|
||||
|
||||
/**
|
||||
* Controller for the opening title window.
|
||||
|
||||
@@ -26,7 +26,6 @@ import javafx.stage.StageStyle;
|
||||
import javafx.util.Duration;
|
||||
import mock.app.Event;
|
||||
|
||||
|
||||
public class App extends Application {
|
||||
private static Stage stage;
|
||||
public static Event game;
|
||||
|
||||
@@ -27,7 +27,6 @@ public class InputChecker {
|
||||
ControlKey controlKey = keyFactory.getKey(codeString);
|
||||
if (controlKey != null) {
|
||||
controlKey.onAction();
|
||||
// System.out.println(controlKey.toString() + " is Pressed.");
|
||||
}
|
||||
currentlyActiveKeys.put(codeString, true);
|
||||
}
|
||||
@@ -38,7 +37,6 @@ public class InputChecker {
|
||||
ControlKey controlKey = keyFactory.getKey(codeString);
|
||||
if (controlKey != null) {
|
||||
controlKey.onRelease();
|
||||
// System.out.println(controlKey.toString() + " is Released.");
|
||||
}
|
||||
currentlyActiveKeys.remove(event.getCode().toString());
|
||||
});
|
||||
@@ -50,15 +48,8 @@ public class InputChecker {
|
||||
ControlKey controlKey = keyFactory.getKey(key);
|
||||
if (controlKey != null){
|
||||
controlKey.onHold();
|
||||
// System.out.println(controlKey.toString() + " is Held.");
|
||||
}
|
||||
}
|
||||
// for (String key : InputKeys.stringKeysMap.keySet()){
|
||||
// if (removeActiveKey(key)) {
|
||||
// System.out.println(key);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
@@ -325,18 +325,6 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
//If the race hasn't started, we set the time since last mark to the current time, to ensure we don't start counting until the race actually starts.
|
||||
if ((boat.getStatus() != BoatStatusEnum.RACING) && (boat.getStatus() == BoatStatusEnum.FINISHED)) {
|
||||
boat.setTimeAtLastMark(visualiserRace.getVisualiserRaceState().getRaceClock().getCurrentTime());
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -504,6 +492,52 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
}
|
||||
|
||||
|
||||
private void drawRoundingLines() {
|
||||
|
||||
|
||||
//ugly hack
|
||||
//rounding lines
|
||||
|
||||
//Boat is within an acceptable distance from the mark.
|
||||
VisualiserBoat boat = null;
|
||||
for (VisualiserBoat visualiserBoat : new ArrayList<>(raceState.getBoats())) {
|
||||
if (visualiserBoat.isClientBoat()) {
|
||||
boat = visualiserBoat;
|
||||
}
|
||||
}
|
||||
if (boat == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Leg currentLeg = boat.getCurrentLeg();
|
||||
|
||||
MarkRoundingData roundingData = raceState.getMarkRoundingSequence().getRoundingData(currentLeg);
|
||||
|
||||
|
||||
|
||||
//To screen coords.
|
||||
GraphCoordinate legEnd = map.convertGPS(roundingData.getMarkToRound().getPosition());
|
||||
GraphCoordinate round1 = map.convertGPS(roundingData.getRoundCheck1());
|
||||
GraphCoordinate round2 = map.convertGPS(roundingData.getRoundCheck2());
|
||||
|
||||
|
||||
gc.strokeLine(
|
||||
legEnd.getX(),
|
||||
legEnd.getY(),
|
||||
round1.getX(),
|
||||
round1.getY() );
|
||||
|
||||
gc.strokeLine(
|
||||
legEnd.getX(),
|
||||
legEnd.getY(),
|
||||
round2.getX(),
|
||||
round2.getY() );
|
||||
|
||||
drawCircle(round1, 12, Color.ORANGE);
|
||||
drawCircle(round2, 12, Color.GREEN);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Draws all of the {@link Mark}s on the canvas.
|
||||
@@ -513,6 +547,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
for (Mark mark : new ArrayList<>(raceState.getMarks())) {
|
||||
drawMark(mark);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -621,6 +656,9 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
//Marks.
|
||||
drawMarks();
|
||||
|
||||
//TEMP
|
||||
drawRoundingLines();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -655,7 +693,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
|
||||
//finds the direction of the current leg as a bearing
|
||||
startDirectionLinePoint = legStartPoint;
|
||||
GPSCoordinate tempEndDirectionLinePoint = legs.get(index).getEndCompoundMark().getAverageGPSCoordinate();
|
||||
GPSCoordinate tempEndDirectionLinePoint = legs.get(index).getEndCompoundMark().getMark1Position();
|
||||
|
||||
bearingOfDirectionLine = GPSCoordinate.calculateBearing(startDirectionLinePoint, tempEndDirectionLinePoint);
|
||||
|
||||
@@ -826,4 +864,4 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user