Skip to content
Snippets Groups Projects
Commit 34ef86f7 authored by jan-schw's avatar jan-schw
Browse files

add missing curly brace

parent 57052dc0
No related branches found
No related tags found
2 merge requests!6Add final version of the game to main branch,!5Add basic implementation
...@@ -38,25 +38,24 @@ public class TicTacToeFX extends Application { ...@@ -38,25 +38,24 @@ public class TicTacToeFX extends Application {
if (gameEvent.getEventType() == GameEvent.VICTORY_EVENT) { if (gameEvent.getEventType() == GameEvent.VICTORY_EVENT) {
dialogVbox.getChildren().add(new Text("This is a victory for player " + currentPlayer + " in turn " + this.currentTurn + "!")); dialogVbox.getChildren().add(new Text("This is a victory for player " + currentPlayer + " in turn " + this.currentTurn + "!"));
} else if (gameEvent.getEventType() == GameEvent.DRAW_EVENT) { } else if (gameEvent.getEventType() == GameEvent.DRAW_EVENT) {
if(gameEvent.getEventType() == GameEvent.VICTORY_EVENT) { if (gameEvent.getEventType() == GameEvent.VICTORY_EVENT) {
dialogVbox.getChildren().add(new Text("This is a victory for player " + currentPlayer + "!")); dialogVbox.getChildren().add(new Text("This is a victory for player " + currentPlayer + "!"));
} } else if (gameEvent.getEventType() == GameEvent.DRAW_EVENT) {
else if(gameEvent.getEventType() == GameEvent.DRAW_EVENT) { dialogVbox.getChildren().add(new Text("This is a Draw!"));
dialogVbox.getChildren().add(new Text("This is a Draw!")); }
}
Button closeButton = new Button(); Button closeButton = new Button();
closeButton.setText("Close"); closeButton.setText("Close");
closeButton.setOnAction(event -> primaryStage.close()); closeButton.setOnAction(event -> primaryStage.close());
dialogVbox.getChildren().add(closeButton); dialogVbox.getChildren().add(closeButton);
dialogVbox.setAlignment(Pos.CENTER); dialogVbox.setAlignment(Pos.CENTER);
Scene dialogScene = new Scene(dialogVbox, 200, 100); Scene dialogScene = new Scene(dialogVbox, 200, 100);
dialog.setScene(dialogScene); dialog.setScene(dialogScene);
dialog.show(); dialog.show();
}
}; };
// Erstelle das das Spielfeld // Erstelle das das Spielfeld
GridPane grid = new GridPane(); GridPane grid = new GridPane();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment