From 1376da3ba61298a62258d0e3ca3d748eca822f4b Mon Sep 17 00:00:00 2001 From: Yvonne Schmidt Date: Sun, 8 Dec 2024 19:00:08 +0100 Subject: [PATCH] added documentation --- .../java/pp/monopoly/client/gui/Toolbar.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java index 20e54d2..5c24b11 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java @@ -446,11 +446,21 @@ public class Toolbar extends Dialog implements GameEventListener { } + ".png"; } + /** + * Handles dice roll events and updates the dice display. + * + * @param event the dice roll event containing dice values + */ @Override public void receivedEvent(DiceRollEvent event) { latestDiceRollEvent = event; } + /** + * Updates the player view by refreshing the player information displayed on the toolbar. + * + * @param event the update player view event + */ @Override public void receivedEvent(UpdatePlayerView event) { playerHandler = app.getGameLogic().getPlayerHandler(); @@ -499,6 +509,12 @@ public class Toolbar extends Dialog implements GameEventListener { } } + /** + * Updates the status of toolbar buttons based on the provided button status event. + * Disables or enables buttons such as trade, property menu, and end turn based on the player's turn status. + * + * @param event the button status event indicating whether the buttons should be enabled + */ @Override public void receivedEvent(ButtonStatusEvent event) { boolean enabled = event.buttonsEnabled(); @@ -508,17 +524,26 @@ public class Toolbar extends Dialog implements GameEventListener { if (endTurnButton != null) endTurnButton.setEnabled(false); } + /** + * Closes the toolbar, detaching it from the GUI. + */ @Override public void close() { app.getGuiNode().detachChild(toolbarContainer); super.close(); } + /** + * Opens the settings menu when the escape key is pressed. + */ @Override public void escape() { new SettingsMenu(app).open(); } + /** + * Updates the toolbar by refreshing player information. + */ @Override public void update() { refreshPlayerView();