diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/ui/gameui/CasinoGameUI.java b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/ui/gameui/CasinoGameUI.java index 5083ee6..4198549 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/ui/gameui/CasinoGameUI.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/ui/gameui/CasinoGameUI.java @@ -1,3 +1,4 @@ + package ch.unibas.dmi.dbis.cs108.casono.client.ui.gameui; import java.io.IOException; @@ -7,17 +8,32 @@ import javafx.scene.Scene; import javafx.stage.Stage; /** - * Hauptklasse für das Casino-Spiel-UI. + * Main class for the casino game UI. * - *
Startet die JavaFX-Anwendung, lädt die grafische Oberfläche aus der FXML-Datei und - * initialisiert die Haupt-Stage für das Spiel. + *
Starts the JavaFX application, loads the graphical interface from the FXML file, + * and initializes the main stage for the game. * - *
Aufgaben: - Lädt die FXML-Oberfläche "/ui-structure/Casinogameui.fxml". - Lädt das - * Anwendungs-Icon aus "/images/logoinverted.png". - Startet die Anwendung im Vollbildmodus. + *
Responsibilities: + * - Loads the FXML interface "/ui-structure/Casinogameui.fxml". + * - Loads the application icon from "/images/logoinverted.png". + * - Starts the application in fullscreen mode. */ +import ch.unibas.dmi.dbis.cs108.casono.client.network.ClientService; + public class CasinoGameUI extends Application { - /** Standardkonstruktor. */ + // Static field for ClientService (workaround for JavaFX Application launch) + private static ClientService staticClientService; + + public static void setClientService(ClientService clientService) { + staticClientService = clientService; + } + + public static ClientService getClientService() { + return staticClientService; + } + + /** Default no-arg constructor. */ public CasinoGameUI() { // default no-arg constructor } @@ -26,15 +42,14 @@ public class CasinoGameUI extends Application { private static final int DEFAULT_HEIGHT = 800; /** - * Startet die Haupt-Stage der Anwendung. + * Starts the main stage of the application. * - * @param stage Die vom System bereitgestellte Haupt-Stage. - * @throws IOException Wenn die FXML-Datei oder Ressourcen nicht geladen werden können. + * @param stage The main stage provided by the system. + * @throws IOException If the FXML file or resources cannot be loaded. */ @Override public void start(Stage stage) throws IOException { - FXMLLoader fxmlLoader = - new FXMLLoader(CasinoGameUI.class.getResource("/ui-structure/Casinogameui.fxml")); + FXMLLoader fxmlLoader = new FXMLLoader(CasinoGameUI.class.getResource("/ui-structure/Casinogameui.fxml")); Scene scene = new Scene(fxmlLoader.load(), DEFAULT_WIDTH, DEFAULT_HEIGHT); stage.setTitle("Casono (GAME)"); @@ -46,9 +61,9 @@ public class CasinoGameUI extends Application { } /** - * Startpunkt der Anwendung. + * Entry point of the application. * - * @param args Befehlszeilenargumente. + * @param args Command line arguments. */ public static void main(String[] args) { launch();