fixed testing env

This commit is contained in:
Johannes Schmelz 2024-12-02 03:02:05 +01:00
parent 2dbc727728
commit 4743a6882c
2 changed files with 3 additions and 1 deletions

View File

@ -18,6 +18,7 @@ import static pp.monopoly.Resources.lookup;
import pp.monopoly.client.GameMusic;
import pp.monopoly.client.GameSound;
import pp.monopoly.client.MonopolyApp;
import pp.monopoly.message.client.NotificationAnswer;
import pp.dialog.Dialog;
import pp.dialog.StateCheckboxModel;
import pp.monopoly.notification.Sound;
@ -60,6 +61,7 @@ public class SettingsMenu extends Dialog {
addChild(new Button("Zurück zum Spiel", new ElementId("button"))).addClickCommands(s -> ifTopDialog(() -> {
this.close(); // Close the StartMenu dialog
app.getGameLogic().send(new NotificationAnswer("hack"));
app.getGameLogic().playSound(Sound.BUTTON);
}));
addChild(new Button("Beenden", new ElementId("button"))).addClickCommands(s -> ifTopDialog(() -> {

View File

@ -425,11 +425,11 @@ public class ServerGameLogic implements ClientInterpreter {
} else if (msg.getA().equals("PayJail")) {
playerHandler.getPlayerById(from).payBail();
} else if(msg.getA().equals("hack")) {
System.out.println("HAck ausgeführt");
for (BuildingProperty bp : boardManager.getPropertyFields( List.of(1,3)).stream().filter(p -> p instanceof BuildingProperty).map(p -> (BuildingProperty) p).collect(Collectors.toList())) {
bp.setOwner(playerHandler.getPlayerById(0));
playerHandler.getPlayerById(0).addProperty(bp.getId());
}
playerHandler.getPlayerAtIndex(0).earnMoney(20000);
}
updateAllPlayers();