diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java index 8ade0d1..c2f0d03 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java @@ -21,6 +21,7 @@ import pp.monopoly.client.gui.popups.*; import pp.monopoly.game.client.ClientGameLogic; import pp.monopoly.game.client.MonopolyClient; import pp.monopoly.game.client.ServerConnection; +import pp.monopoly.model.card.DeckHelper; // TODO für den Import der Queue notwendig import pp.monopoly.model.fields.BoardManager; import pp.monopoly.notification.GameEventListener; import pp.monopoly.notification.InfoTextEvent; @@ -46,6 +47,9 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga // TODO Temp später entfernen + + private DeckHelper deckHelper = new DeckHelper(); //TODO für den Import der Queue notwendig + private EventCard eventCard; private BuildingPropertyCard buildingProperty; private FoodFieldCard foodField; @@ -92,6 +96,12 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga return boardManager; } + // TODO analoge Implementierung zum Boardmamager zum Testen der EventCardPopups + + public DeckHelper getDeckHelper(){ + return deckHelper; + } + public NetworkSupport getNetworkSupport() { return networkSupport; } diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/EventCard.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/EventCard.java index 60e4cb3..2736b54 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/EventCard.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/EventCard.java @@ -12,8 +12,8 @@ import com.simsilica.lemur.component.QuadBackgroundComponent; import com.simsilica.lemur.style.ElementId; import pp.dialog.Dialog; import pp.monopoly.client.MonopolyApp; -import pp.monopoly.model.fields.BuildingProperty; +import pp.monopoly.model.card.Card; // TODO für den Import der Queue notwendig /** * SettingsMenu ist ein Overlay-Menü, das durch ESC aufgerufen werden kann. */ @@ -23,14 +23,13 @@ public class EventCard extends Dialog { private final Container eventCardContainer; private final Container backgroundContainer; - private int index = 37; public EventCard(MonopolyApp app) { super(app.getDialogManager()); this.app = app; //Generate the corresponfing field - BuildingProperty field = (BuildingProperty) app.getBoardManager().getFieldAtIndex(index); + Card card = app.getDeckHelper().drawCard(); // TODO nimmt die Karten gerade unabhängig aus dem DeckHelper // Halbtransparentes Overlay hinzufügen overlayBackground = createOverlayBackground(); @@ -54,7 +53,7 @@ public class EventCard extends Dialog { // Text, der auf der Karte steht // Die Preise werden dynamisch dem BoardManager entnommen Container propertyValuesContainer = eventCardContainer.addChild(new Container()); - propertyValuesContainer.addChild(new Label("Hier könnte ihre Beschreibung stehen ", new ElementId("label-Text"))); + propertyValuesContainer.addChild(new Label(card.getDescription(), new ElementId("label-Text"))); propertyValuesContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f))); // Beenden-Button diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/client/ClientGameLogic.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/client/ClientGameLogic.java index dda8499..9459dca 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/client/ClientGameLogic.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/client/ClientGameLogic.java @@ -214,7 +214,7 @@ public class ClientGameLogic implements ServerInterpreter, GameEventBroker { @Override public void received(EventDrawCard msg) { setInfoText("Event card drawn: " + msg.getCardDescription()); - //event card logic + // Kartenlogik playSound(Sound.EVENT_CARD); } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/card/Card.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/card/Card.java index 8a25f5e..fb1e615 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/card/Card.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/card/Card.java @@ -15,9 +15,9 @@ public class Card { visitor.visit(this, player); } - String getDescription() { + public String getDescription() { return description; - } + } // TODO wird gerade in der EventCard zur erstellung des Popup genutzt String getKeyword() { return keyword;