added documentation for MonopolyApp

This commit is contained in:
Yvonne Schmidt 2024-12-02 03:44:33 +01:00
parent 95dc7b07e2
commit 7acf448c0c

View File

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