mirror of
				https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
				synced 2025-11-02 22:21:04 +01:00 
			
		
		
		
	added documentation
This commit is contained in:
		@@ -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();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user