mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-11-25 04:39:43 +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.ClientGameLogic;
|
||||||
import pp.monopoly.game.client.MonopolyClient;
|
import pp.monopoly.game.client.MonopolyClient;
|
||||||
import pp.monopoly.game.client.ServerConnection;
|
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.model.fields.BoardManager;
|
||||||
import pp.monopoly.notification.GameEventListener;
|
import pp.monopoly.notification.GameEventListener;
|
||||||
import pp.monopoly.notification.InfoTextEvent;
|
import pp.monopoly.notification.InfoTextEvent;
|
||||||
@ -46,6 +47,9 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
|
|||||||
|
|
||||||
// TODO Temp später entfernen
|
// TODO Temp später entfernen
|
||||||
|
|
||||||
|
|
||||||
|
private DeckHelper deckHelper = new DeckHelper(); //TODO für den Import der Queue notwendig
|
||||||
|
|
||||||
private EventCard eventCard;
|
private EventCard eventCard;
|
||||||
private BuildingPropertyCard buildingProperty;
|
private BuildingPropertyCard buildingProperty;
|
||||||
private FoodFieldCard foodField;
|
private FoodFieldCard foodField;
|
||||||
@ -92,6 +96,12 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
|
|||||||
return boardManager;
|
return boardManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO analoge Implementierung zum Boardmamager zum Testen der EventCardPopups
|
||||||
|
|
||||||
|
public DeckHelper getDeckHelper(){
|
||||||
|
return deckHelper;
|
||||||
|
}
|
||||||
|
|
||||||
public NetworkSupport getNetworkSupport() {
|
public NetworkSupport getNetworkSupport() {
|
||||||
return networkSupport;
|
return networkSupport;
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,8 @@ import com.simsilica.lemur.component.QuadBackgroundComponent;
|
|||||||
import com.simsilica.lemur.style.ElementId;
|
import com.simsilica.lemur.style.ElementId;
|
||||||
import pp.dialog.Dialog;
|
import pp.dialog.Dialog;
|
||||||
import pp.monopoly.client.MonopolyApp;
|
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.
|
* 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 eventCardContainer;
|
||||||
private final Container backgroundContainer;
|
private final Container backgroundContainer;
|
||||||
|
|
||||||
private int index = 37;
|
|
||||||
|
|
||||||
public EventCard(MonopolyApp app) {
|
public EventCard(MonopolyApp app) {
|
||||||
super(app.getDialogManager());
|
super(app.getDialogManager());
|
||||||
this.app = app;
|
this.app = app;
|
||||||
|
|
||||||
//Generate the corresponfing field
|
//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
|
// Halbtransparentes Overlay hinzufügen
|
||||||
overlayBackground = createOverlayBackground();
|
overlayBackground = createOverlayBackground();
|
||||||
@ -54,7 +53,7 @@ public class EventCard extends Dialog {
|
|||||||
// Text, der auf der Karte steht
|
// Text, der auf der Karte steht
|
||||||
// Die Preise werden dynamisch dem BoardManager entnommen
|
// Die Preise werden dynamisch dem BoardManager entnommen
|
||||||
Container propertyValuesContainer = eventCardContainer.addChild(new Container());
|
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)));
|
propertyValuesContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
||||||
|
|
||||||
// Beenden-Button
|
// Beenden-Button
|
||||||
|
@ -214,7 +214,7 @@ public class ClientGameLogic implements ServerInterpreter, GameEventBroker {
|
|||||||
@Override
|
@Override
|
||||||
public void received(EventDrawCard msg) {
|
public void received(EventDrawCard msg) {
|
||||||
setInfoText("Event card drawn: " + msg.getCardDescription());
|
setInfoText("Event card drawn: " + msg.getCardDescription());
|
||||||
//event card logic
|
// Kartenlogik
|
||||||
playSound(Sound.EVENT_CARD);
|
playSound(Sound.EVENT_CARD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,9 +15,9 @@ public class Card {
|
|||||||
visitor.visit(this, player);
|
visitor.visit(this, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
String getDescription() {
|
public String getDescription() {
|
||||||
return description;
|
return description;
|
||||||
}
|
} // TODO wird gerade in der EventCard zur erstellung des Popup genutzt
|
||||||
|
|
||||||
String getKeyword() {
|
String getKeyword() {
|
||||||
return keyword;
|
return keyword;
|
||||||
|
Loading…
Reference in New Issue
Block a user