From e81cdf3b4033df54d61b35ecb11fbb237a983123 Mon Sep 17 00:00:00 2001 From: Yvonne Schmidt Date: Mon, 2 Dec 2024 08:49:26 +0100 Subject: [PATCH] added documentation for WinnerPopUp --- .../client/gui/popups/WinnerPopUp.java | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/WinnerPopUp.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/WinnerPopUp.java index afe1e3e..fdcde84 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/WinnerPopUp.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/WinnerPopUp.java @@ -16,12 +16,24 @@ import pp.dialog.Dialog; import pp.monopoly.client.MonopolyApp; import pp.monopoly.notification.Sound; +/** + * WinnerPopUp is a dialog displayed when a player wins the Monopoly game. + *

+ * This popup congratulates the player for their victory and provides an option to quit the game. + *

+ */ public class WinnerPopUp extends Dialog { + /** Reference to the Monopoly application instance. */ private final MonopolyApp app; - private final Geometry overlayBackground; - private final Container WinnerContainer; - private final Container backgroundContainer; + /** Semi-transparent overlay background for the dialog. */ + private final Geometry overlayBackground; + + /** Main container for the "Winner" dialog UI. */ + private final Container WinnerContainer; + + /** Background container providing a styled border around the main dialog. */ + private final Container backgroundContainer; /** * Constructs a new WinnerPopUp dialog. @@ -94,9 +106,9 @@ public class WinnerPopUp extends Dialog { } /** - * Erstellt einen halbtransparenten Hintergrund für das Menü. + * Creates a semi-transparent background overlay for the popup. * - * @return Geometrie des Overlays + * @return The overlay geometry. */ private Geometry createOverlayBackground() { Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight()); @@ -110,7 +122,7 @@ public class WinnerPopUp extends Dialog { } /** - * Schließt das Menü und entfernt die GUI-Elemente. + * Closes the WinnerPopUp dialog and removes its GUI elements. */ @Override public void close() { @@ -120,6 +132,9 @@ public class WinnerPopUp extends Dialog { super.close(); } + /** + * Handles the escape action to close the dialog. + */ @Override public void escape() { close();