mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-08-03 15:57:08 +02:00
added trigger for winner looser popup
This commit is contained in:
@@ -226,12 +226,10 @@ public class ClientGameLogic implements ServerInterpreter, GameEventBroker {
|
||||
@Override
|
||||
public void received(GameOver msg) {
|
||||
if (msg.isWinner()) {
|
||||
|
||||
//Winner popup
|
||||
notifyListeners(new PopUpEvent("Winner"));
|
||||
playSound(Sound.WINNER);
|
||||
} else {
|
||||
|
||||
// Looser popup
|
||||
notifyListeners(new PopUpEvent("Looser"));
|
||||
playSound(Sound.LOSER);
|
||||
}
|
||||
}
|
||||
@@ -333,6 +331,6 @@ public class ClientGameLogic implements ServerInterpreter, GameEventBroker {
|
||||
|
||||
@Override
|
||||
public void received(BuyPropertyRequest msg) {
|
||||
notifyListeners(new PopUpEvent());
|
||||
notifyListeners(new PopUpEvent("Buy"));
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package pp.monopoly.notification;
|
||||
|
||||
public record PopUpEvent() implements GameEvent{
|
||||
public record PopUpEvent(String msg) implements GameEvent{
|
||||
|
||||
@Override
|
||||
public void notifyListener(GameEventListener listener) {
|
||||
|
Reference in New Issue
Block a user