resolve merge conflicts

This commit is contained in:
Johannes Schmelz 2024-11-29 05:33:03 +01:00
parent 1ccdea0c87
commit 316433f592
2 changed files with 9 additions and 27 deletions

View File

@ -4,27 +4,25 @@ import java.util.List;
import pp.monopoly.client.MonopolyApp; import pp.monopoly.client.MonopolyApp;
import pp.monopoly.client.gui.popups.BuyCard; import pp.monopoly.client.gui.popups.BuyCard;
import pp.monopoly.client.gui.popups.EventCard;
import pp.monopoly.client.gui.popups.FoodFieldCard; import pp.monopoly.client.gui.popups.FoodFieldCard;
import pp.monopoly.client.gui.popups.GateFieldCard; import pp.monopoly.client.gui.popups.GateFieldCard;
import pp.monopoly.game.server.Player; import pp.monopoly.game.server.Player;
import pp.monopoly.model.fields.BuildingProperty; import pp.monopoly.model.fields.BuildingProperty;
import pp.monopoly.model.fields.FoodField; import pp.monopoly.model.fields.FoodField;
import pp.monopoly.model.fields.GateField; import pp.monopoly.model.fields.GateField;
import pp.monopoly.model.fields.PropertyField;
import pp.monopoly.notification.DiceRollEvent;
import pp.monopoly.notification.EventCardEvent;
import pp.monopoly.notification.GameEventListener; import pp.monopoly.notification.GameEventListener;
import pp.monopoly.notification.PopUpEvent; import pp.monopoly.notification.PopUpEvent;
/** /**
* TestWorld zeigt eine einfache Szene mit Spielfeld und Spielfiguren. * TestWorld zeigt eine einfache Szene mit Spielfeld und Spielfiguren.
*/ */
public class TestWorld { public class TestWorld implements GameEventListener{
private final MonopolyApp app; private final MonopolyApp app;
private final List<Player> players; // Liste der Spieler, bereits aus GameStart geladen private final List<Player> players; // Liste der Spieler, bereits aus GameStart geladen
private CameraController cameraController; private CameraController cameraController;
private Toolbar toolbar;
/** /**
* Konstruktor für die TestWorld. * Konstruktor für die TestWorld.
@ -35,6 +33,7 @@ public class TestWorld {
public TestWorld(MonopolyApp app, List<Player> players) { public TestWorld(MonopolyApp app, List<Player> players) {
this.app = app; this.app = app;
this.players = players; this.players = players;
app.getGameLogic().removeListener(this);
} }
/** /**
@ -52,6 +51,8 @@ public class TestWorld {
createBoard(); createBoard();
createPlayerFigures(); // Lädt Figuren aus der bereits vorhandenen Liste createPlayerFigures(); // Lädt Figuren aus der bereits vorhandenen Liste
setupCamera(); setupCamera();
toolbar = new Toolbar(app);
toolbar.open();
} }
/** /**

View File

@ -156,28 +156,9 @@ public class Toolbar extends Dialog implements GameEventListener {
animatingDice = true; animatingDice = true;
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
Thread diceAnimation = new Thread(() -> { new Thread(() -> {
int[] currentFace = {1};
try { try {
while (System.currentTimeMillis() - startTime < 2000) { // Animation läuft für 4 Sekunden animateDice(startTime);
currentFace[0] = (currentFace[0] % 6) + 1;
String rotatingImage1 = diceToString(currentFace[0]);
String rotatingImage2 = diceToString((currentFace[0] % 6) + 1);
IconComponent newIcon1 = new IconComponent(rotatingImage1);
newIcon1.setIconSize(new Vector2f(100, 100));
app.enqueue(() -> imageLabel.setIcon(newIcon1));
IconComponent newIcon2 = new IconComponent(rotatingImage2);
newIcon2.setIconSize(new Vector2f(100, 100));
app.enqueue(() -> imageLabel2.setIcon(newIcon2));
// Warte 100 ms, bevor die Bilder wechseln
Thread.sleep(100);
}
// Animation beenden
animatingDice = false; animatingDice = false;
if (latestDiceRollEvent != null) { if (latestDiceRollEvent != null) {
showFinalDiceResult(latestDiceRollEvent); showFinalDiceResult(latestDiceRollEvent);