mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-19 02:36:14 +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.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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -155,29 +155,10 @@ public class Toolbar extends Dialog implements GameEventListener {
|
|||||||
private void startDiceAnimation() {
|
private void startDiceAnimation() {
|
||||||
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user