added documentation for Gulag

This commit is contained in:
Yvonne Schmidt 2024-12-02 08:42:08 +01:00
parent cc157a3cf3
commit a4c0afe277

View File

@ -16,16 +16,29 @@ import pp.monopoly.client.MonopolyApp;
import pp.monopoly.notification.Sound; 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.
* <p>
* This popup informs the player that they are being sent to the Gulag and includes a confirmation button.
* </p>
*/ */
public class Gulag extends Dialog { public class Gulag 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 Gulag warning message. */
private final Container gulagContainer; private final Container gulagContainer;
/** Background container providing a border for the popup. */
private final Container backgroundContainer; 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) { public Gulag(MonopolyApp app) {
super(app.getDialogManager()); super(app.getDialogManager());
this.app = app; 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() { private Geometry createOverlayBackground() {
Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight()); 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 @Override
public void close() { public void close() {
@ -108,6 +121,9 @@ public class Gulag extends Dialog {
super.close(); super.close();
} }
/**
* Handles the escape action to close the popup.
*/
@Override @Override
public void escape() { public void escape() {
close(); close();