mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Added a check if race started, then start screen switches to race view automatically.
#story[572]
This commit is contained in:
@@ -89,6 +89,10 @@ public class Controller implements Initializable {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
|
if (StreamParser.isRaceStarted()) {
|
||||||
|
switchToRaceView();
|
||||||
|
timer.cancel();
|
||||||
|
}
|
||||||
if (StreamParser.isRaceFinished()) {
|
if (StreamParser.isRaceFinished()) {
|
||||||
realTime.setText(StreamParser.getCurrentTimeString());
|
realTime.setText(StreamParser.getCurrentTimeString());
|
||||||
timeTillLive.setTextFill(Color.RED);
|
timeTillLive.setTextFill(Color.RED);
|
||||||
|
|||||||
@@ -309,7 +309,6 @@ public class RaceViewController extends Thread{
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
for (Yacht boat : StreamParser.getBoatsPos().values()) {
|
for (Yacht boat : StreamParser.getBoatsPos().values()) {
|
||||||
System.out.println(boat.getBoatStatus());
|
|
||||||
if (boat.getBoatStatus() == 3) { // 3 is finish status
|
if (boat.getBoatStatus() == 3) { // 3 is finish status
|
||||||
positionVbox.getChildren().add(new Text(boat.getPosition() + ". " +
|
positionVbox.getChildren().add(new Text(boat.getPosition() + ". " +
|
||||||
boat.getShortName() + " (Finished)"));
|
boat.getShortName() + " (Finished)"));
|
||||||
|
|||||||
Reference in New Issue
Block a user