mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-18 22:56:15 +01:00
added documentation for ConfirmTrade
This commit is contained in:
parent
4ac02a1a7b
commit
25361933d7
@ -20,12 +20,23 @@ import pp.monopoly.notification.Sound;
|
|||||||
* ConfirmTrade is a popup which appears when a trade is proposed to this certain player.
|
* ConfirmTrade is a popup which appears when a trade is proposed to this certain player.
|
||||||
*/
|
*/
|
||||||
public class ConfirmTrade extends Dialog {
|
public class ConfirmTrade extends Dialog {
|
||||||
|
/** Reference to the Monopoly application instance. */
|
||||||
private final MonopolyApp app;
|
private final MonopolyApp app;
|
||||||
|
|
||||||
|
/** Main container for the "Confirm Trade" popup UI. */
|
||||||
private final Container confirmTradeContainer;
|
private final Container confirmTradeContainer;
|
||||||
|
|
||||||
|
/** Background container providing a border for the popup. */
|
||||||
private final Container backgroundContainer;
|
private final Container backgroundContainer;
|
||||||
|
|
||||||
|
/** The trade handler managing the details of the trade proposal. */
|
||||||
private TradeHandler tradeHandler;
|
private TradeHandler tradeHandler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs the "Confirm Trade" popup.
|
||||||
|
*
|
||||||
|
* @param app the Monopoly application instance
|
||||||
|
*/
|
||||||
public ConfirmTrade(MonopolyApp app) {
|
public ConfirmTrade(MonopolyApp app) {
|
||||||
super(app.getDialogManager());
|
super(app.getDialogManager());
|
||||||
this.app = app;
|
this.app = app;
|
||||||
@ -33,13 +44,12 @@ public class ConfirmTrade extends Dialog {
|
|||||||
|
|
||||||
// Create the background container
|
// Create the background container
|
||||||
backgroundContainer = new Container();
|
backgroundContainer = new Container();
|
||||||
backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Darker background
|
backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f)));
|
||||||
attachChild(backgroundContainer);
|
attachChild(backgroundContainer);
|
||||||
|
|
||||||
// Hauptcontainer für das Bestätigungspopup
|
|
||||||
confirmTradeContainer = new Container();
|
confirmTradeContainer = new Container();
|
||||||
|
|
||||||
float padding = 10; // Passt den backgroundContainer an die Größe des confirmTradeContainer an
|
float padding = 10;
|
||||||
backgroundContainer.setPreferredSize(confirmTradeContainer.getPreferredSize().addLocal(padding, padding, 0));
|
backgroundContainer.setPreferredSize(confirmTradeContainer.getPreferredSize().addLocal(padding, padding, 0));
|
||||||
|
|
||||||
// Titel
|
// Titel
|
||||||
@ -122,15 +132,18 @@ public class ConfirmTrade extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Schließt das Menü und entfernt die GUI-Elemente.
|
* Closes the popup and removes its GUI elements.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
app.getGuiNode().detachChild(confirmTradeContainer); // Entferne das Menü
|
app.getGuiNode().detachChild(confirmTradeContainer);
|
||||||
app.getGuiNode().detachChild(backgroundContainer); //Entfernt Rand
|
app.getGuiNode().detachChild(backgroundContainer);
|
||||||
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();
|
||||||
|
Loading…
Reference in New Issue
Block a user