diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/NoMoneyWarning.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/NoMoneyWarning.java index a4d3c21..1bbff5a 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/NoMoneyWarning.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/NoMoneyWarning.java @@ -15,16 +15,32 @@ import pp.dialog.Dialog; import pp.monopoly.client.MonopolyApp; /** - * Bankrupt is a Warning-Popup which appears when the balance is negative at the end of a player´s turn + * NoMoneyWarning is a warning popup that appears when a player tries to perform + * an action they cannot afford due to insufficient funds, such as attempting + * to purchase a property or building. + *
+ * This dialog notifies the player of their lack of funds and provides a single + * confirmation button to close the dialog. + *
*/ public class NoMoneyWarning extends Dialog { + /** Reference to the Monopoly application instance. */ private final MonopolyApp app; + + /** Semi-transparent overlay background for the warning popup. */ private final Geometry overlayBackground; + + /** Main container for the NoMoneyWarning dialog UI. */ private final Container noMoneyWarningContainer; + + /** Background container providing a styled border around the main dialog. */ private final Container backgroundContainer; - - + /** + * Constructs a new NoMoneyWarning dialog. + * + * @param app The MonopolyApp instance. + */ public NoMoneyWarning(MonopolyApp app) { super(app.getDialogManager()); this.app = app; @@ -85,9 +101,9 @@ public class NoMoneyWarning extends Dialog { } /** - * Erstellt einen halbtransparenten Hintergrund für das Menü. + * Creates a semi-transparent overlay background for the dialog. * - * @return Geometrie des Overlays + * @return The geometry representing the overlay background. */ private Geometry createOverlayBackground() { Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight()); @@ -111,6 +127,9 @@ public class NoMoneyWarning extends Dialog { super.close(); } + /** + * Handles the escape action to close the dialog. + */ @Override public void escape() { close();