mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-19 00:06:16 +01:00
resolve merge conflicts
This commit is contained in:
parent
1ccdea0c87
commit
316433f592
@ -4,27 +4,25 @@ import java.util.List;
|
||||
|
||||
import pp.monopoly.client.MonopolyApp;
|
||||
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.GateFieldCard;
|
||||
import pp.monopoly.game.server.Player;
|
||||
import pp.monopoly.model.fields.BuildingProperty;
|
||||
import pp.monopoly.model.fields.FoodField;
|
||||
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.PopUpEvent;
|
||||
|
||||
/**
|
||||
* TestWorld zeigt eine einfache Szene mit Spielfeld und Spielfiguren.
|
||||
*/
|
||||
public class TestWorld {
|
||||
public class TestWorld implements GameEventListener{
|
||||
|
||||
private final MonopolyApp app;
|
||||
private final List<Player> players; // Liste der Spieler, bereits aus GameStart geladen
|
||||
private CameraController cameraController;
|
||||
private Toolbar toolbar;
|
||||
|
||||
/**
|
||||
* Konstruktor für die TestWorld.
|
||||
@ -35,6 +33,7 @@ public class TestWorld {
|
||||
public TestWorld(MonopolyApp app, List<Player> players) {
|
||||
this.app = app;
|
||||
this.players = players;
|
||||
app.getGameLogic().removeListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -52,6 +51,8 @@ public class TestWorld {
|
||||
createBoard();
|
||||
createPlayerFigures(); // Lädt Figuren aus der bereits vorhandenen Liste
|
||||
setupCamera();
|
||||
toolbar = new Toolbar(app);
|
||||
toolbar.open();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -155,29 +155,10 @@ public class Toolbar extends Dialog implements GameEventListener {
|
||||
private void startDiceAnimation() {
|
||||
animatingDice = true;
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
Thread diceAnimation = new Thread(() -> {
|
||||
int[] currentFace = {1};
|
||||
|
||||
new Thread(() -> {
|
||||
try {
|
||||
while (System.currentTimeMillis() - startTime < 2000) { // Animation läuft für 4 Sekunden
|
||||
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
|
||||
animateDice(startTime);
|
||||
animatingDice = false;
|
||||
if (latestDiceRollEvent != null) {
|
||||
showFinalDiceResult(latestDiceRollEvent);
|
||||
|
Loading…
Reference in New Issue
Block a user