added documentation for WinnerPopUp

This commit is contained in:
Yvonne Schmidt 2024-12-02 08:49:26 +01:00
parent bffe614b54
commit e81cdf3b40

View File

@ -16,12 +16,24 @@ import pp.dialog.Dialog;
import pp.monopoly.client.MonopolyApp; import pp.monopoly.client.MonopolyApp;
import pp.monopoly.notification.Sound; import pp.monopoly.notification.Sound;
/**
* WinnerPopUp is a dialog displayed when a player wins the Monopoly game.
* <p>
* This popup congratulates the player for their victory and provides an option to quit the game.
* </p>
*/
public class WinnerPopUp extends Dialog { public class WinnerPopUp extends Dialog {
/** Reference to the Monopoly application instance. */
private final MonopolyApp app; 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. * 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() { private Geometry createOverlayBackground() {
Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight()); 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 @Override
public void close() { public void close() {
@ -120,6 +132,9 @@ public class WinnerPopUp extends Dialog {
super.close(); super.close();
} }
/**
* Handles the escape action to close the dialog.
*/
@Override @Override
public void escape() { public void escape() {
close(); close();