diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/AcceptTrade.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/AcceptTrade.java index f2fb28f..6a6795d 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/AcceptTrade.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/AcceptTrade.java @@ -17,16 +17,32 @@ import pp.monopoly.message.server.TradeReply; import pp.monopoly.notification.Sound; /** - * Bankrupt is a Warning-Popup which appears when the balance is negative at the end of a player´s turn + * Represents a confirmation dialog that appears when a trade is accepted . + *

+ * Displays a message to the user informing them that the trade they proposed has been accepted, + * along with a confirmation button to close the dialog. + *

*/ public class AcceptTrade extends Dialog { + /** Reference to the Monopoly application instance. */ private final MonopolyApp app; + + /** Semi-transparent overlay background for the dialog. */ private final Geometry overlayBackground; + + /** Container for the warning message content. */ private final Container noMoneyWarningContainer; + + /** Background container providing a border for the dialog. */ private final Container backgroundContainer; - + /** + * Constructs the accept trade dialog. + * + * @param app the Monopoly application instance + * @param msg the trade reply message containing details about the trade + */ public AcceptTrade(MonopolyApp app, TradeReply msg) { super(app.getDialogManager()); this.app = app; @@ -92,9 +108,9 @@ public class AcceptTrade extends Dialog { } /** - * Erstellt einen halbtransparenten Hintergrund für das Menü. + * Creates a semi-transparent background overlay for the dialog. * - * @return Geometrie des Overlays + * @return the geometry of the overlay */ private Geometry createOverlayBackground() { Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight()); @@ -108,7 +124,7 @@ public class AcceptTrade extends Dialog { } /** - * Closes the menu and removes the GUI elements. + * Closes the dialog and removes the associated GUI elements. */ @Override public void close() { @@ -118,6 +134,9 @@ public class AcceptTrade extends Dialog { super.close(); } + /** + * Handles the escape key action by closing the dialog. + */ @Override public void escape() { close();