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:
@@ -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