added documentation for Bankrupt

This commit is contained in:
Yvonne Schmidt 2024-12-02 07:59:24 +01:00
parent 3a43ea10d9
commit 9e50c1afe2

View File

@ -18,13 +18,24 @@ 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 * Bankrupt is a Warning-Popup which appears when the balance is negative at the end of a player´s turn
*/ */
public class Bankrupt extends Dialog { public class Bankrupt extends Dialog {
/** Reference to the Monopoly application instance. */
private final MonopolyApp app; private final MonopolyApp app;
/** Semi-transparent overlay background for the popup. */
private final Geometry overlayBackground; private final Geometry overlayBackground;
/** Main container for the bankruptcy warning content. */
private final Container bankruptContainer; private final Container bankruptContainer;
/** Background container providing a border for the popup. */
private final Container backgroundContainer; private final Container backgroundContainer;
/**
* Constructs the bankruptcy warning popup.
*
* @param app the Monopoly application instance
*/
public Bankrupt(MonopolyApp app) { public Bankrupt(MonopolyApp app) {
super(app.getDialogManager()); super(app.getDialogManager());
this.app = app; this.app = app;
@ -85,9 +96,9 @@ public class Bankrupt 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 geometry of the overlay
*/ */
private Geometry createOverlayBackground() { private Geometry createOverlayBackground() {
Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight()); Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight());
@ -111,6 +122,9 @@ public class Bankrupt extends Dialog {
super.close(); super.close();
} }
/**
* Handles the escape key action by closing the popup.
*/
@Override @Override
public void escape() { public void escape() {
close(); close();