can now dynamically update toolbar view

This commit is contained in:
Johannes Schmelz
2024-11-26 18:50:24 +01:00
parent c71e8b1e8e
commit 174958c6b1
3 changed files with 68 additions and 22 deletions

View File

@@ -46,5 +46,17 @@ public interface GameEventListener {
*/
default void receivedEvent(ClientStateEvent event) { /* do nothing */ }
/**
* Indicates that the dice result has changed.
*
* @param event the received event
*/
default void receivedEvent(DiceRollEvent event) { /*Do nothing */}
/**
* Indicates that the players assets have changed.
*
* @param event the received event
*/
default void receivedEvent(UpdatePlayerView event) { /*Do nothing */}
}

View File

@@ -0,0 +1,13 @@
package pp.monopoly.notification;
public record UpdatePlayerView() implements GameEvent{
/**
* Notifies the game event listener of this event.
*
* @param listener the game event listener
*/
@Override
public void notifyListener(GameEventListener listener) {
listener.receivedEvent(this);
}
}