From 7acf448c0cfae13559b76e1e06df476daf226c3d Mon Sep 17 00:00:00 2001 From: Yvonne Schmidt Date: Mon, 2 Dec 2024 03:44:33 +0100 Subject: [PATCH] added documentation for MonopolyApp --- .../java/pp/monopoly/client/MonopolyApp.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java index ad5db00..d2616a0 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java @@ -153,7 +153,7 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga } /** - * Starts the Battleship application. + * Starts the Monopoly application. * * @param args Command-line arguments for launching the application. */ @@ -220,9 +220,9 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga } /** - * Returns the current configuration settings for the Battleship client. + * Returns the current configuration settings for the Monopoly client. * - * @return The {@link BattleshipClientConfig} instance. //TODO Fehler im Kommentar + * @return The {@link pp.monopoly.game.client.MonopolyClientConfig} instance. */ @Override public MonopolyAppConfig getConfig() { @@ -276,7 +276,7 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga } - //logik zum wechselnden erscheinen und verschwinden beim drücken von B //TODO süäter entfernen + //logik zum wechselnden erscheinen und verschwinden beim drücken von B //TODO später entfernen private void handleB(boolean isPressed) { if (isPressed) { Dialog tmp = new GulagInfo(this, 3); @@ -482,10 +482,24 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga .open(); } + /** + * Disconnects the current server connection. + * + * This method delegates the disconnection operation to the `disconnect` method of the + * `serverConnection` object. + * + */ public void disconnect() { serverConnection.disconnect(); } + /** + * Retrieves the unique identifier associated with the server connection. + * + * Checks if a Server is connected and returns {@Code 0} if there is no connection + * + * @return the ID of the connected Server instance. + */ public int getId() { if (serverConnection != null && serverConnection instanceof NetworkSupport) return ((NetworkSupport) serverConnection).getId(); return 0;