From a4c0afe27729f72f55fbb33979a35819b7b09576 Mon Sep 17 00:00:00 2001 From: Yvonne Schmidt Date: Mon, 2 Dec 2024 08:42:08 +0100 Subject: [PATCH] added documentation for Gulag --- .../pp/monopoly/client/gui/popups/Gulag.java | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/Gulag.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/Gulag.java index 3d5e3dc..4d41045 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/Gulag.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/Gulag.java @@ -16,16 +16,29 @@ import pp.monopoly.client.MonopolyApp; import pp.monopoly.notification.Sound; /** - * Gulag is a warning popup that is triggered when a certain player enters the "Wache" field + * Gulag is a warning popup triggered when a player lands on the "Wache" field in the Monopoly game. + *

+ * This popup informs the player that they are being sent to the Gulag and includes a confirmation button. + *

*/ public class Gulag extends Dialog { + /** Reference to the Monopoly application instance. */ private final MonopolyApp app; + + /** Semi-transparent overlay background for the popup. */ private final Geometry overlayBackground; + + /** Main container for the Gulag warning message. */ private final Container gulagContainer; + + /** Background container providing a border for the popup. */ private final Container backgroundContainer; - - + /** + * Constructs the Gulag popup, displaying a warning when a player lands on the "Wache" field. + * + * @param app the Monopoly application instance + */ public Gulag(MonopolyApp app) { super(app.getDialogManager()); this.app = app; @@ -82,9 +95,9 @@ public class Gulag extends Dialog { } /** - * Erstellt einen halbtransparenten Hintergrund für das Menü. + * Creates a semi-transparent overlay background for the popup. * - * @return Geometrie des Overlays + * @return the geometry of the overlay */ private Geometry createOverlayBackground() { Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight()); @@ -98,7 +111,7 @@ public class Gulag extends Dialog { } /** - * Schließt das Menü und entfernt die GUI-Elemente. + * Closes the popup and removes its associated GUI elements. */ @Override public void close() { @@ -108,6 +121,9 @@ public class Gulag extends Dialog { super.close(); } + /** + * Handles the escape action to close the popup. + */ @Override public void escape() { close();