mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-11-25 02:19:45 +01:00
EventCard erweitert
This commit is contained in:
parent
a6944aa6e3
commit
687d1621fc
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user