added documentation for BuildingAdminMenu

This commit is contained in:
Yvonne Schmidt 2024-12-02 07:48:57 +01:00
parent d0ba0d011f
commit 3539b1cf23

View File

@ -18,18 +18,46 @@ import pp.monopoly.client.gui.popups.SellHouse;
import pp.monopoly.client.gui.popups.TakeMortage; import pp.monopoly.client.gui.popups.TakeMortage;
import pp.monopoly.notification.Sound; import pp.monopoly.notification.Sound;
/**
* Represents the building administration menu in the Monopoly application.
* <p>
* Provides options to manage properties, including building houses, demolishing houses,
* taking mortgages, repaying mortgages, and viewing an overview of owned properties.
* </p>
*/
public class BuildingAdminMenu extends Dialog { public class BuildingAdminMenu extends Dialog {
/** Reference to the Monopoly application instance. */
private final MonopolyApp app; private final MonopolyApp app;
/** Main container for the menu's UI components. */
private final Container mainContainer; private final Container mainContainer;
/** Background geometry for the menu. */
private Geometry background; private Geometry background;
/** Button to navigate back to the previous menu. */
private final Button backButton = new Button("Zurück"); private final Button backButton = new Button("Zurück");
/** Button to build houses on properties. */
private final Button buildButton = new Button("Bauen"); private final Button buildButton = new Button("Bauen");
/** Button to demolish houses on properties. */
private final Button demolishButton = new Button("Abriss"); private final Button demolishButton = new Button("Abriss");
/** Button to take out a mortgage on properties. */
private final Button takeMortgageButton = new Button("Hypothek aufnehmen"); private final Button takeMortgageButton = new Button("Hypothek aufnehmen");
/** Button to repay a mortgage on properties. */
private final Button payMortgageButton = new Button("Hypothek bezahlen"); private final Button payMortgageButton = new Button("Hypothek bezahlen");
/** Button to open the property overview menu. */
private final Button overviewButton = new Button("Übersicht"); private final Button overviewButton = new Button("Übersicht");
/**
* Constructs the building administration menu.
*
* @param app the Monopoly application instance
*/
public BuildingAdminMenu(MonopolyApp app) { public BuildingAdminMenu(MonopolyApp app) {
super(app.getDialogManager()); super(app.getDialogManager());
this.app = app; this.app = app;
@ -163,6 +191,9 @@ public class BuildingAdminMenu extends Dialog {
app.getGuiNode().attachChild(background); app.getGuiNode().attachChild(background);
} }
/**
* Closes the building administration menu and detaches its elements from the GUI.
*/
@Override @Override
public void close() { public void close() {
app.getGuiNode().detachChild(mainContainer); app.getGuiNode().detachChild(mainContainer);
@ -170,11 +201,19 @@ public class BuildingAdminMenu extends Dialog {
super.close(); super.close();
} }
/**
* Opens the settings menu when the escape key is pressed.
*/
@Override @Override
public void escape() { public void escape() {
new SettingsMenu(app).open(); new SettingsMenu(app).open();
} }
/**
* Periodic updates for the menu, if required.
*
* @param delta Time since the last update in seconds.
*/
@Override @Override
public void update(float delta) { public void update(float delta) {
// Periodic updates if necessary // Periodic updates if necessary