mirror of
				https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
				synced 2025-11-04 08:56:15 +01:00 
			
		
		
		
	Compare commits
	
		
			10 Commits
		
	
	
		
			10e24cf30e
			...
			44c55ce3a6
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					44c55ce3a6 | ||
| 
						 | 
					895bea048c | ||
| 
						 | 
					885ab5bdc9 | ||
| 
						 | 
					c6355b2c09 | ||
| 
						 | 
					ada6bf3f24 | ||
| 
						 | 
					db471ac679 | ||
| 
						 | 
					84059c4085 | ||
| 
						 | 
					09b363f943 | ||
| 
						 | 
					fd347c7780 | ||
| 
						 | 
					b38a34efa5 | 
@@ -258,3 +258,30 @@ selector("menu-button", "pp") {
 | 
			
		||||
    buttonCommands = stdButtonCommands
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Style for Selector text
 | 
			
		||||
selector("selector.item.label") {
 | 
			
		||||
    color = color(0, 0, 0, 1)  // Black text
 | 
			
		||||
    fontSize = 16  // Optional: Adjust the text size if needed
 | 
			
		||||
    textHAlignment = HAlignment.Left  // Optional: Align text to the left
 | 
			
		||||
    insets = new Insets3f(2, 2, 2, 2)  // Optional: Add padding around text
 | 
			
		||||
}
 | 
			
		||||
// Style the popup container background
 | 
			
		||||
selector("selector.popup") {
 | 
			
		||||
    background = new QuadBackgroundComponent(new ColorRGBA(1, 1, 1, 0.8f))  // Translucent white background
 | 
			
		||||
    insets = new Insets3f(5, 5, 5, 5)  // Padding inside the popup container
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Style the text of dropdown options
 | 
			
		||||
selector("selector.item.label") {
 | 
			
		||||
    color = color(0, 0, 0, 1)  // Black text
 | 
			
		||||
    fontSize = 16  // Optional: Adjust font size
 | 
			
		||||
    textHAlignment = HAlignment.Left  // Align text to the left
 | 
			
		||||
    insets = new Insets3f(2, 5, 2, 5)  // Add padding for each option
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Style the hover state of dropdown options
 | 
			
		||||
selector("selector.item.label", "hover") {
 | 
			
		||||
    color = color(1, 1, 1, 1)  // White text when hovered
 | 
			
		||||
    background = new QuadBackgroundComponent(new ColorRGBA(0.2f, 0.6f, 1.0f, 0.9f))  // Highlighted background
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -16,12 +16,15 @@ import com.simsilica.lemur.style.BaseStyles;
 | 
			
		||||
import pp.dialog.DialogBuilder;
 | 
			
		||||
import pp.dialog.DialogManager;
 | 
			
		||||
import pp.graphics.Draw;
 | 
			
		||||
import pp.monopoly.client.gui.SettingsMenu;
 | 
			
		||||
import pp.monopoly.client.gui.TestWorld;
 | 
			
		||||
import pp.monopoly.client.gui.*;
 | 
			
		||||
import pp.monopoly.client.gui.popups.BuildingPropertyCard;
 | 
			
		||||
import pp.monopoly.client.gui.popups.BuyCard;
 | 
			
		||||
import pp.monopoly.client.gui.popups.FoodFieldCard;
 | 
			
		||||
import pp.monopoly.client.gui.popups.GateFieldCard;
 | 
			
		||||
import pp.monopoly.game.client.ClientGameLogic;
 | 
			
		||||
import pp.monopoly.game.client.MonopolyClient;
 | 
			
		||||
import pp.monopoly.game.client.ServerConnection;
 | 
			
		||||
import pp.monopoly.model.fields.BoardManager;
 | 
			
		||||
import pp.monopoly.notification.GameEventListener;
 | 
			
		||||
import pp.monopoly.notification.InfoTextEvent;
 | 
			
		||||
import pp.monopoly.server.MonopolyServer;
 | 
			
		||||
@@ -42,8 +45,13 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
 | 
			
		||||
    private boolean inputBlocked = false;
 | 
			
		||||
    private MonopolyServer monopolyServer;
 | 
			
		||||
    private NetworkSupport networkSupport;
 | 
			
		||||
    private BoardManager boardManager = new BoardManager();
 | 
			
		||||
 | 
			
		||||
    // TODO Temp später entfernen
 | 
			
		||||
 | 
			
		||||
    private BuildingPropertyCard buildingProperty;
 | 
			
		||||
    private FoodFieldCard foodField;
 | 
			
		||||
    private GateFieldCard gateField;
 | 
			
		||||
    private BuyCard buyCard;
 | 
			
		||||
    private boolean isBuyCardPopupOpen = false;
 | 
			
		||||
    private final ActionListener BListener = (name, isPressed, tpf) -> handleB(isPressed);
 | 
			
		||||
@@ -82,6 +90,10 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
 | 
			
		||||
        return logic;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public BoardManager getBoardManager() {
 | 
			
		||||
        return boardManager;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public NetworkSupport getNetworkSupport() {
 | 
			
		||||
        return networkSupport;
 | 
			
		||||
    }
 | 
			
		||||
@@ -99,6 +111,8 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
 | 
			
		||||
        GuiGlobals.initialize(this);
 | 
			
		||||
        BaseStyles.loadStyleResources(STYLES_SCRIPT);
 | 
			
		||||
        GuiGlobals.getInstance().getStyles().setDefaultStyle("pp"); // NON-NLS
 | 
			
		||||
        BaseStyles.loadStyleResources("com/simsilica/lemur/style/base/glass-styles.groovy");
 | 
			
		||||
        GuiGlobals.getInstance().getStyles();
 | 
			
		||||
        final BitmapFont normalFont = assetManager.loadFont(FONT); // NON-NLS
 | 
			
		||||
 | 
			
		||||
        setupInput();
 | 
			
		||||
@@ -143,20 +157,20 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //logik zum wechselnden erscheinen und verschwinden beim drücken von B
 | 
			
		||||
    //logik zum wechselnden erscheinen und verschwinden beim drücken von B //TODO süäter entfernen
 | 
			
		||||
    private void handleB(boolean isPressed) {
 | 
			
		||||
        if (isPressed) {
 | 
			
		||||
            if (buyCard != null && isBuyCardPopupOpen) {
 | 
			
		||||
            if (gateField != null && isBuyCardPopupOpen) {
 | 
			
		||||
                // Schließe das SettingsMenu
 | 
			
		||||
                System.out.println("Schließe BuyCardPopup...");
 | 
			
		||||
                buyCard.close();
 | 
			
		||||
                buyCard = null;
 | 
			
		||||
                gateField.close();
 | 
			
		||||
                gateField = null;
 | 
			
		||||
                setBuyCardPopupOpen(false);
 | 
			
		||||
            } else {
 | 
			
		||||
                // Öffne das SettingsMenu
 | 
			
		||||
                System.out.println("Öffne BuyCardPopup...");
 | 
			
		||||
                buyCard = new BuyCard(this);
 | 
			
		||||
                buyCard.open();
 | 
			
		||||
                gateField = new GateFieldCard(this);
 | 
			
		||||
                gateField.open();
 | 
			
		||||
                setBuyCardPopupOpen(true);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
@@ -224,6 +238,8 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
 | 
			
		||||
        this.isSettingsMenuOpen = isOpen;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // TODO später entfernen
 | 
			
		||||
 | 
			
		||||
    public void setBuyCardPopupOpen(boolean isOpen) {
 | 
			
		||||
        this.isBuyCardPopupOpen = isOpen;
 | 
			
		||||
    }
 | 
			
		||||
@@ -241,8 +257,9 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
 | 
			
		||||
        testWorld.initializeScene(); // Initialisiere die Szene
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void startBuyCard() {
 | 
			
		||||
    // TODO später entfernen
 | 
			
		||||
 | 
			
		||||
    public void startBuyCard() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void returnToMenu() {
 | 
			
		||||
 
 | 
			
		||||
@@ -110,6 +110,8 @@ public class CreateGameMenu {
 | 
			
		||||
            }
 | 
			
		||||
        }, "OpenTestWorld");
 | 
			
		||||
 | 
			
		||||
        // TODO später entfernen
 | 
			
		||||
 | 
			
		||||
        app.getInputManager().addMapping("OpenBuyCard", new com.jme3.input.controls.KeyTrigger(com.jme3.input.KeyInput.KEY_B));
 | 
			
		||||
        app.getInputManager().addListener(new com.jme3.input.controls.ActionListener() {
 | 
			
		||||
            @Override
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,7 @@
 | 
			
		||||
package pp.monopoly.client.gui;
 | 
			
		||||
 | 
			
		||||
import com.jme3.app.Application;
 | 
			
		||||
import com.jme3.app.state.BaseAppState;
 | 
			
		||||
import com.jme3.material.Material;
 | 
			
		||||
import com.jme3.math.ColorRGBA;
 | 
			
		||||
import com.jme3.math.Vector3f;
 | 
			
		||||
@@ -16,14 +18,19 @@ import com.simsilica.lemur.TextField;
 | 
			
		||||
import com.simsilica.lemur.component.QuadBackgroundComponent;
 | 
			
		||||
import com.simsilica.lemur.component.SpringGridLayout;
 | 
			
		||||
 | 
			
		||||
import com.simsilica.lemur.core.VersionedList;
 | 
			
		||||
import com.simsilica.lemur.core.VersionedReference;
 | 
			
		||||
import com.simsilica.lemur.style.ElementId;
 | 
			
		||||
import pp.monopoly.client.MonopolyApp;
 | 
			
		||||
 | 
			
		||||
import java.util.Set;
 | 
			
		||||
 | 
			
		||||
public class LobbyMenu {
 | 
			
		||||
 | 
			
		||||
    private final MonopolyApp app;
 | 
			
		||||
    private final Container menuContainer;
 | 
			
		||||
    private Geometry background;
 | 
			
		||||
    private final Selector<String> dropdown;
 | 
			
		||||
 | 
			
		||||
    public LobbyMenu(MonopolyApp app) {
 | 
			
		||||
        this.app = app;
 | 
			
		||||
@@ -46,7 +53,7 @@ public class LobbyMenu {
 | 
			
		||||
        horizontalContainer.setPreferredSize(new Vector3f(600, 50, 0)); // Adjust container size
 | 
			
		||||
        horizontalContainer.setBackground(null);
 | 
			
		||||
 | 
			
		||||
        Label title = horizontalContainer.addChild(new Label("Startkapital:",new ElementId("label-Bold")));
 | 
			
		||||
        Label title = horizontalContainer.addChild(new Label("Startkapital:", new ElementId("label-Bold")));
 | 
			
		||||
        title.setFontSize(48);
 | 
			
		||||
 | 
			
		||||
        // Add a spacer between the title and the input field
 | 
			
		||||
@@ -76,20 +83,20 @@ public class LobbyMenu {
 | 
			
		||||
        playerListContainer.setBackground(null);
 | 
			
		||||
        Label playersLabel = playerListContainer.addChild(new Label("Noch keine Spieler verbunden.")); // Beispieltext
 | 
			
		||||
 | 
			
		||||
        // Dropdown menu for game options
 | 
			
		||||
        Selector<String> dropdown = new Selector<>();
 | 
			
		||||
        for (int i = 1; i <= 10; i++) { // Generate 10 options
 | 
			
		||||
            dropdown.getModel().add("Option " + i);
 | 
			
		||||
        }
 | 
			
		||||
        VersionedList<String> items = new VersionedList<>();
 | 
			
		||||
        items.add("Alpha");
 | 
			
		||||
        items.add("Beta");
 | 
			
		||||
        items.add("Gamma");
 | 
			
		||||
        items.add("Back");
 | 
			
		||||
 | 
			
		||||
        menuContainer.addChild(new Label("Game Options:")); // Add a label for clarity
 | 
			
		||||
        dropdown = new Selector<>(items,"glass");
 | 
			
		||||
        dropdown.setBackground(new QuadBackgroundComponent(ColorRGBA.Black));
 | 
			
		||||
        menuContainer.addChild(dropdown);
 | 
			
		||||
 | 
			
		||||
        // Adjust the dropdown's popup container size if necessary
 | 
			
		||||
        Vector3f dimens = menuContainer.getPreferredSize();
 | 
			
		||||
        Vector3f dimens2 = dropdown.getPopupContainer().getPreferredSize();
 | 
			
		||||
        dimens2.setX(dimens.getX());
 | 
			
		||||
        dropdown.getPopupContainer().setPreferredSize(dimens2);
 | 
			
		||||
        // Add the custom action listener
 | 
			
		||||
        addSelectionActionListener(dropdown, this::onDropdownSelectionChanged);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        // Buttons
 | 
			
		||||
        Container buttonContainer = menuContainer.addChild(new Container(new SpringGridLayout(Axis.X, Axis.Y)));
 | 
			
		||||
@@ -146,4 +153,71 @@ public class LobbyMenu {
 | 
			
		||||
        app.getGuiNode().detachChild(background); // Entfernt das Hintergrundbild
 | 
			
		||||
        new CreateGameMenu(app);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Adds a custom action listener to the Selector.
 | 
			
		||||
     */
 | 
			
		||||
    private void addSelectionActionListener(Selector<String> selector, SelectionActionListener<String> listener) {
 | 
			
		||||
        VersionedReference<Set<Integer>> selectionRef = selector.getSelectionModel().createReference();
 | 
			
		||||
 | 
			
		||||
        app.getStateManager().attach(new BaseAppState() {
 | 
			
		||||
            @Override
 | 
			
		||||
            public void update(float tpf) {
 | 
			
		||||
                if (selectionRef.update()) {
 | 
			
		||||
                    String selected = selectionRef.get().toString();
 | 
			
		||||
                    System.out.println(selected);
 | 
			
		||||
                    listener.onSelectionChanged(selected);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            @Override
 | 
			
		||||
            protected void initialize(Application app) {
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            @Override
 | 
			
		||||
            protected void cleanup(Application app) {
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            @Override
 | 
			
		||||
            protected void onEnable() {
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            @Override
 | 
			
		||||
            protected void onDisable() {
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Callback for when the dropdown selection changes.
 | 
			
		||||
     */
 | 
			
		||||
    private void onDropdownSelectionChanged(String selected) {
 | 
			
		||||
        System.out.println("Selected: " + selected);
 | 
			
		||||
        switch (selected) {
 | 
			
		||||
            case "[0]":
 | 
			
		||||
                System.out.println("Alpha selected");
 | 
			
		||||
                break;
 | 
			
		||||
            case "[1]":
 | 
			
		||||
                System.out.println("Beta selected");
 | 
			
		||||
                break;
 | 
			
		||||
            case "[2]":
 | 
			
		||||
                System.out.println("Gamma selected");
 | 
			
		||||
                break;
 | 
			
		||||
            case "[3]":
 | 
			
		||||
                goBackToCreateGame();
 | 
			
		||||
                break;
 | 
			
		||||
            default:
 | 
			
		||||
                System.out.println("Unknown selection");
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Functional interface for a selection action listener.
 | 
			
		||||
     */
 | 
			
		||||
    @FunctionalInterface
 | 
			
		||||
    private interface SelectionActionListener<T> {
 | 
			
		||||
        void onSelectionChanged(T selection);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,133 @@
 | 
			
		||||
package pp.monopoly.client.gui.popups;
 | 
			
		||||
 | 
			
		||||
import com.jme3.material.Material;
 | 
			
		||||
import com.jme3.material.RenderState.BlendMode;
 | 
			
		||||
import com.jme3.math.ColorRGBA;
 | 
			
		||||
import com.jme3.scene.Geometry;
 | 
			
		||||
import com.jme3.scene.shape.Quad;
 | 
			
		||||
import com.simsilica.lemur.Button;
 | 
			
		||||
import com.simsilica.lemur.Container;
 | 
			
		||||
import com.simsilica.lemur.Label;
 | 
			
		||||
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;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * TODO Kommentare fixen
 | 
			
		||||
 * SettingsMenu ist ein Overlay-Menü, das durch ESC aufgerufen werden kann.
 | 
			
		||||
 */
 | 
			
		||||
public class BuildingPropertyCard extends Dialog {
 | 
			
		||||
    private final MonopolyApp app;
 | 
			
		||||
    private final Geometry overlayBackground;
 | 
			
		||||
    private final Container settingsContainer;
 | 
			
		||||
    private final Container backgroundContainer;
 | 
			
		||||
    private int index = 23;
 | 
			
		||||
 | 
			
		||||
    public BuildingPropertyCard(MonopolyApp app) {
 | 
			
		||||
        super(app.getDialogManager());
 | 
			
		||||
        this.app = app;
 | 
			
		||||
 | 
			
		||||
        // Titel
 | 
			
		||||
        //Generate the corresponfing field
 | 
			
		||||
        BuildingProperty field = (BuildingProperty) app.getBoardManager().getFieldAtIndex(index);
 | 
			
		||||
 | 
			
		||||
        // Halbtransparentes Overlay hinzufügen
 | 
			
		||||
        overlayBackground = createOverlayBackground();
 | 
			
		||||
        app.getGuiNode().attachChild(overlayBackground);
 | 
			
		||||
 | 
			
		||||
        // Create the background container
 | 
			
		||||
        backgroundContainer = new Container();
 | 
			
		||||
        backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Darker background
 | 
			
		||||
        app.getGuiNode().attachChild(backgroundContainer);
 | 
			
		||||
 | 
			
		||||
        // Hauptcontainer für das Menü
 | 
			
		||||
        settingsContainer = new Container();
 | 
			
		||||
        //settingsContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(170 / 255f, 223 / 255f, 246 / 255f, 1))); // hell
 | 
			
		||||
        settingsContainer.setBackground(new QuadBackgroundComponent(field.getColor().getColor())); //dunkel
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        Label settingsTitle = settingsContainer.addChild(new Label( field.getName(), new ElementId("settings-title"))); 
 | 
			
		||||
        settingsTitle.setFontSize(48);
 | 
			
		||||
 | 
			
		||||
        // Effekt-Sound: Slider und Checkbox
 | 
			
		||||
        Container propertyValuesContainer = settingsContainer.addChild(new Container());
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„Grundstückswert: " + field.getPrice() + " EUR", new ElementId("label-Text")));
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„Miete allein: " + field.getAllRent().get(0)+ " EUR", new ElementId("label-Text")));
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„-mit 1 Haus: " + field.getAllRent().get(1) + " EUR", new ElementId("label-Text")));
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„-mit 2 Häuser: " + field.getAllRent().get(2) + " EUR", new ElementId("label-Text")));
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„-mit 3 Häuser: " + field.getAllRent().get(3) + " EUR", new ElementId("label-Text")));
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„-mit 4 Häuser: " + field.getAllRent().get(4) + " EUR", new ElementId("label-Text")));
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„-mit 1 Hotel: " + field.getAllRent().get(5) + " EUR", new ElementId("label-Text")));
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„-1 Haus kostet: " + field.getHousePrice()+ " EUR", new ElementId("label-Text")));
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„Hypothek: " + field.getHypo() + " EUR", new ElementId("label-Text")));
 | 
			
		||||
        propertyValuesContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
 | 
			
		||||
 | 
			
		||||
        // Beenden-Button
 | 
			
		||||
        Button quitButton = settingsContainer.addChild(new Button("Beenden", new ElementId("button")));
 | 
			
		||||
        quitButton.setFontSize(32);
 | 
			
		||||
        // Kaufen-Button
 | 
			
		||||
        Button buyButton = settingsContainer.addChild(new Button("Kaufen", new ElementId("button")));
 | 
			
		||||
        buyButton.setFontSize(32);
 | 
			
		||||
 | 
			
		||||
        float padding = 10; // Padding around the settingsContainer for the background
 | 
			
		||||
        backgroundContainer.setPreferredSize(settingsContainer.getPreferredSize().addLocal(padding, padding, 0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        // Zentriere das Menü
 | 
			
		||||
        settingsContainer.setLocalTranslation(
 | 
			
		||||
            (app.getCamera().getWidth() - settingsContainer.getPreferredSize().x) / 2,
 | 
			
		||||
            (app.getCamera().getHeight() + settingsContainer.getPreferredSize().y) / 2,
 | 
			
		||||
            8
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        backgroundContainer.setLocalTranslation(
 | 
			
		||||
                (app.getCamera().getWidth() - settingsContainer.getPreferredSize().x - padding) / 2,
 | 
			
		||||
                (app.getCamera().getHeight() + settingsContainer.getPreferredSize().y+ padding) / 2,
 | 
			
		||||
                7
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        app.getGuiNode().attachChild(settingsContainer);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Erstellt einen halbtransparenten Hintergrund für das Menü.
 | 
			
		||||
     *
 | 
			
		||||
     * @return Geometrie des Overlays
 | 
			
		||||
     */
 | 
			
		||||
    private Geometry createOverlayBackground() {
 | 
			
		||||
        Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight());
 | 
			
		||||
        Geometry overlay = new Geometry("Overlay", quad);
 | 
			
		||||
        Material material = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
 | 
			
		||||
        material.setColor("Color", new ColorRGBA(0, 0, 0, 0.5f)); // Halbtransparent
 | 
			
		||||
        material.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
 | 
			
		||||
        overlay.setMaterial(material);
 | 
			
		||||
        overlay.setLocalTranslation(0, 0, 0);
 | 
			
		||||
        return overlay;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Schließt das Menü und entfernt die GUI-Elemente.
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void close() {
 | 
			
		||||
        System.out.println("Schließe SettingsMenu..."); // Debugging-Ausgabe
 | 
			
		||||
        app.getGuiNode().detachChild(settingsContainer);  // Entferne das Menü
 | 
			
		||||
        app.getGuiNode().detachChild(backgroundContainer); //Entfernt Rand
 | 
			
		||||
        app.getGuiNode().detachChild(overlayBackground);  // Entferne das Overlay
 | 
			
		||||
        app.setSettingsMenuOpen(false);                  // Menü als geschlossen markieren
 | 
			
		||||
        app.unblockInputs();                             // Eingaben wieder aktivieren
 | 
			
		||||
        System.out.println("SettingsMenu geschlossen."); // Debugging-Ausgabe
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    public void setIndex(int index) {
 | 
			
		||||
        this.index = index;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -41,14 +41,18 @@ public class BuyCard extends Dialog {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        // Titel
 | 
			
		||||
        Label settingsTitle = settingsContainer.addChild(new Label("Gebäude XX", new ElementId("settings-title"))); //TODO Dynamische Gebäudezahl einfügen
 | 
			
		||||
        Label settingsTitle = settingsContainer.addChild(new Label("Gebäude 30", new ElementId("settings-title"))); //TODO Dynamische Gebäudezahl einfügen
 | 
			
		||||
        settingsTitle.setFontSize(48);
 | 
			
		||||
 | 
			
		||||
        int i = 0;
 | 
			
		||||
        int a = 10;
 | 
			
		||||
        int b = -45;
 | 
			
		||||
 | 
			
		||||
        // Effekt-Sound: Slider und Checkbox
 | 
			
		||||
        Container propertyValuesContainer = settingsContainer.addChild(new Container());
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„Preis: XXXX", new ElementId("label-Text")));//TODO Variable hier einsetzen
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„Miete: XXXX", new ElementId("label-Text")));//TODO Variable hier einsetzen
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„Hypothek: XXXX", new ElementId("label-Text")));//TODO Variable hier einsetzen
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„Preis:" + i, new ElementId("label-Text")));//TODO Variable hier einsetzen
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„Miete:" + a, new ElementId("label-Text")));//TODO Variable hier einsetzen
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„Hypothek:" + b, new ElementId("label-Text")));//TODO Variable hier einsetzen
 | 
			
		||||
        propertyValuesContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
 | 
			
		||||
 | 
			
		||||
        // Beenden-Button
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,117 @@
 | 
			
		||||
package pp.monopoly.client.gui.popups;
 | 
			
		||||
 | 
			
		||||
import com.jme3.material.Material;
 | 
			
		||||
import com.jme3.material.RenderState.BlendMode;
 | 
			
		||||
import com.jme3.math.ColorRGBA;
 | 
			
		||||
import com.jme3.scene.Geometry;
 | 
			
		||||
import com.jme3.scene.shape.Quad;
 | 
			
		||||
import com.simsilica.lemur.Button;
 | 
			
		||||
import com.simsilica.lemur.Container;
 | 
			
		||||
import com.simsilica.lemur.Label;
 | 
			
		||||
import com.simsilica.lemur.component.QuadBackgroundComponent;
 | 
			
		||||
import com.simsilica.lemur.style.ElementId;
 | 
			
		||||
import pp.dialog.Dialog;
 | 
			
		||||
import pp.monopoly.client.MonopolyApp;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * SettingsMenu ist ein Overlay-Menü, das durch ESC aufgerufen werden kann.
 | 
			
		||||
 */
 | 
			
		||||
public class FoodFieldCard extends Dialog {
 | 
			
		||||
    private final MonopolyApp app;
 | 
			
		||||
    private final Geometry overlayBackground;
 | 
			
		||||
    private final Container settingsContainer;
 | 
			
		||||
    private final Container backgroundContainer;
 | 
			
		||||
 | 
			
		||||
    public FoodFieldCard(MonopolyApp app) {
 | 
			
		||||
        super(app.getDialogManager());
 | 
			
		||||
        this.app = app;
 | 
			
		||||
 | 
			
		||||
        // Halbtransparentes Overlay hinzufügen
 | 
			
		||||
        overlayBackground = createOverlayBackground();
 | 
			
		||||
        app.getGuiNode().attachChild(overlayBackground);
 | 
			
		||||
 | 
			
		||||
        // Create the background container
 | 
			
		||||
        backgroundContainer = new Container();
 | 
			
		||||
        backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Darker background
 | 
			
		||||
        app.getGuiNode().attachChild(backgroundContainer);
 | 
			
		||||
 | 
			
		||||
        // Hauptcontainer für das Menü
 | 
			
		||||
        settingsContainer = new Container();
 | 
			
		||||
        settingsContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.1f, 0.1f, 0.1f, 0.9f)));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        // Titel
 | 
			
		||||
        Label settingsTitle = settingsContainer.addChild(new Label("Gebäude 30", new ElementId("settings-title"))); //TODO Dynamische Gebäudezahl einfügen
 | 
			
		||||
        settingsTitle.setFontSize(48);
 | 
			
		||||
 | 
			
		||||
        int i = 0;
 | 
			
		||||
        int a = 10;
 | 
			
		||||
        int b = -45;
 | 
			
		||||
 | 
			
		||||
        // Effekt-Sound: Slider und Checkbox
 | 
			
		||||
        Container propertyValuesContainer = settingsContainer.addChild(new Container());
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„Preis:" + i, new ElementId("label-Text")));//TODO Variable hier einsetzen
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„Miete:" + a, new ElementId("label-Text")));//TODO Variable hier einsetzen
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„Hypothek:" + b, new ElementId("label-Text")));//TODO Variable hier einsetzen
 | 
			
		||||
        propertyValuesContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
 | 
			
		||||
 | 
			
		||||
        // Beenden-Button
 | 
			
		||||
        Button quitButton = settingsContainer.addChild(new Button("Beenden", new ElementId("button")));
 | 
			
		||||
        quitButton.setFontSize(32);
 | 
			
		||||
        // Kaufen-Button
 | 
			
		||||
        Button buyButton = settingsContainer.addChild(new Button("Kaufen", new ElementId("button")));
 | 
			
		||||
        buyButton.setFontSize(32);
 | 
			
		||||
 | 
			
		||||
        float padding = 10; // Padding around the settingsContainer for the background
 | 
			
		||||
        backgroundContainer.setPreferredSize(settingsContainer.getPreferredSize().addLocal(padding, padding, 0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        // Zentriere das Menü
 | 
			
		||||
        settingsContainer.setLocalTranslation(
 | 
			
		||||
            (app.getCamera().getWidth() - settingsContainer.getPreferredSize().x) / 2,
 | 
			
		||||
            (app.getCamera().getHeight() + settingsContainer.getPreferredSize().y) / 2,
 | 
			
		||||
            8
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        backgroundContainer.setLocalTranslation(
 | 
			
		||||
                (app.getCamera().getWidth() - settingsContainer.getPreferredSize().x - padding) / 2,
 | 
			
		||||
                (app.getCamera().getHeight() + settingsContainer.getPreferredSize().y+ padding) / 2,
 | 
			
		||||
                7
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        app.getGuiNode().attachChild(settingsContainer);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Erstellt einen halbtransparenten Hintergrund für das Menü.
 | 
			
		||||
     *
 | 
			
		||||
     * @return Geometrie des Overlays
 | 
			
		||||
     */
 | 
			
		||||
    private Geometry createOverlayBackground() {
 | 
			
		||||
        Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight());
 | 
			
		||||
        Geometry overlay = new Geometry("Overlay", quad);
 | 
			
		||||
        Material material = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
 | 
			
		||||
        material.setColor("Color", new ColorRGBA(0, 0, 0, 0.5f)); // Halbtransparent
 | 
			
		||||
        material.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
 | 
			
		||||
        overlay.setMaterial(material);
 | 
			
		||||
        overlay.setLocalTranslation(0, 0, 0);
 | 
			
		||||
        return overlay;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Schließt das Menü und entfernt die GUI-Elemente.
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void close() {
 | 
			
		||||
        System.out.println("Schließe SettingsMenu..."); // Debugging-Ausgabe
 | 
			
		||||
        app.getGuiNode().detachChild(settingsContainer);  // Entferne das Menü
 | 
			
		||||
        app.getGuiNode().detachChild(backgroundContainer); //Entfernt Rand
 | 
			
		||||
        app.getGuiNode().detachChild(overlayBackground);  // Entferne das Overlay
 | 
			
		||||
        app.setSettingsMenuOpen(false);                  // Menü als geschlossen markieren
 | 
			
		||||
        app.unblockInputs();                             // Eingaben wieder aktivieren
 | 
			
		||||
        System.out.println("SettingsMenu geschlossen."); // Debugging-Ausgabe
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,115 @@
 | 
			
		||||
package pp.monopoly.client.gui.popups;
 | 
			
		||||
 | 
			
		||||
import com.jme3.material.Material;
 | 
			
		||||
import com.jme3.material.RenderState.BlendMode;
 | 
			
		||||
import com.jme3.math.ColorRGBA;
 | 
			
		||||
import com.jme3.scene.Geometry;
 | 
			
		||||
import com.jme3.scene.shape.Quad;
 | 
			
		||||
import com.simsilica.lemur.Button;
 | 
			
		||||
import com.simsilica.lemur.Container;
 | 
			
		||||
import com.simsilica.lemur.Label;
 | 
			
		||||
import com.simsilica.lemur.component.QuadBackgroundComponent;
 | 
			
		||||
import com.simsilica.lemur.style.ElementId;
 | 
			
		||||
import pp.dialog.Dialog;
 | 
			
		||||
import pp.monopoly.client.MonopolyApp;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * SettingsMenu ist ein Overlay-Menü, das durch ESC aufgerufen werden kann.
 | 
			
		||||
 */
 | 
			
		||||
public class GateFieldCard extends Dialog {
 | 
			
		||||
    private final MonopolyApp app;
 | 
			
		||||
    private final Geometry overlayBackground;
 | 
			
		||||
    private final Container settingsContainer;
 | 
			
		||||
    private final Container backgroundContainer;
 | 
			
		||||
 | 
			
		||||
    public GateFieldCard(MonopolyApp app) {
 | 
			
		||||
        super(app.getDialogManager());
 | 
			
		||||
        this.app = app;
 | 
			
		||||
 | 
			
		||||
        // Halbtransparentes Overlay hinzufügen
 | 
			
		||||
        overlayBackground = createOverlayBackground();
 | 
			
		||||
        app.getGuiNode().attachChild(overlayBackground);
 | 
			
		||||
 | 
			
		||||
        // Create the background container
 | 
			
		||||
        backgroundContainer = new Container();
 | 
			
		||||
        backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Darker background
 | 
			
		||||
        app.getGuiNode().attachChild(backgroundContainer);
 | 
			
		||||
 | 
			
		||||
        // Hauptcontainer für das Menü
 | 
			
		||||
        settingsContainer = new Container();
 | 
			
		||||
        settingsContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0 / 255f, 0 / 255f, 0 / 255f, 1)));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        // Titel
 | 
			
		||||
        Label settingsTitle = settingsContainer.addChild(new Label("Gebäude 30", new ElementId("settings-title"))); //TODO Dynamische Gebäudezahl einfügen
 | 
			
		||||
        settingsTitle.setFontSize(48);
 | 
			
		||||
        settingsTitle.setColor(ColorRGBA.Black);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        // Effekt-Sound: Slider und Checkbox
 | 
			
		||||
        Container propertyValuesContainer = settingsContainer.addChild(new Container());
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„Preis:", new ElementId("label-Text")));//TODO Variable hier einsetzen
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„Miete:", new ElementId("label-Text")));//TODO Variable hier einsetzen
 | 
			
		||||
        propertyValuesContainer.addChild(new Label("„Hypothek:", new ElementId("label-Text")));//TODO Variable hier einsetzen
 | 
			
		||||
        propertyValuesContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
 | 
			
		||||
 | 
			
		||||
        // Beenden-Button
 | 
			
		||||
        Button quitButton = settingsContainer.addChild(new Button("Beenden", new ElementId("button")));
 | 
			
		||||
        quitButton.setFontSize(32);
 | 
			
		||||
        // Kaufen-Button
 | 
			
		||||
        Button buyButton = settingsContainer.addChild(new Button("Kaufen", new ElementId("button")));
 | 
			
		||||
        buyButton.setFontSize(32);
 | 
			
		||||
 | 
			
		||||
        float padding = 10; // Padding around the settingsContainer for the background
 | 
			
		||||
        backgroundContainer.setPreferredSize(settingsContainer.getPreferredSize().addLocal(padding, padding, 0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        // Zentriere das Menü
 | 
			
		||||
        settingsContainer.setLocalTranslation(
 | 
			
		||||
            (app.getCamera().getWidth() - settingsContainer.getPreferredSize().x) / 2,
 | 
			
		||||
            (app.getCamera().getHeight() + settingsContainer.getPreferredSize().y) / 2,
 | 
			
		||||
            8
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        backgroundContainer.setLocalTranslation(
 | 
			
		||||
                (app.getCamera().getWidth() - settingsContainer.getPreferredSize().x - padding) / 2,
 | 
			
		||||
                (app.getCamera().getHeight() + settingsContainer.getPreferredSize().y+ padding) / 2,
 | 
			
		||||
                7
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        app.getGuiNode().attachChild(settingsContainer);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Erstellt einen halbtransparenten Hintergrund für das Menü.
 | 
			
		||||
     *
 | 
			
		||||
     * @return Geometrie des Overlays
 | 
			
		||||
     */
 | 
			
		||||
    private Geometry createOverlayBackground() {
 | 
			
		||||
        Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight());
 | 
			
		||||
        Geometry overlay = new Geometry("Overlay", quad);
 | 
			
		||||
        Material material = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
 | 
			
		||||
        material.setColor("Color", new ColorRGBA(0, 0, 0, 0.5f)); // Halbtransparent
 | 
			
		||||
        material.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
 | 
			
		||||
        overlay.setMaterial(material);
 | 
			
		||||
        overlay.setLocalTranslation(0, 0, 0);
 | 
			
		||||
        return overlay;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Schließt das Menü und entfernt die GUI-Elemente.
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void close() {
 | 
			
		||||
        System.out.println("Schließe SettingsMenu..."); // Debugging-Ausgabe
 | 
			
		||||
        app.getGuiNode().detachChild(settingsContainer);  // Entferne das Menü
 | 
			
		||||
        app.getGuiNode().detachChild(backgroundContainer); //Entfernt Rand
 | 
			
		||||
        app.getGuiNode().detachChild(overlayBackground);  // Entferne das Overlay
 | 
			
		||||
        app.setSettingsMenuOpen(false);                  // Menü als geschlossen markieren
 | 
			
		||||
        app.unblockInputs();                             // Eingaben wieder aktivieren
 | 
			
		||||
        System.out.println("SettingsMenu geschlossen."); // Debugging-Ausgabe
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,49 @@
 | 
			
		||||
package pp.monopoly.client.gui.popups;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * $Id$
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 2013-2013 jMonkeyEngine
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions are
 | 
			
		||||
 * met:
 | 
			
		||||
 *
 | 
			
		||||
 * * Redistributions of source code must retain the above copyright
 | 
			
		||||
 *   notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 *
 | 
			
		||||
 * * Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *   notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *   documentation and/or other materials provided with the distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
 | 
			
		||||
 *   may be used to endorse or promote products derived from this software
 | 
			
		||||
 *   without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 | 
			
		||||
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 | 
			
		||||
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 | 
			
		||||
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 | 
			
		||||
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 | 
			
		||||
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 | 
			
		||||
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 | 
			
		||||
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 | 
			
		||||
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 | 
			
		||||
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
import com.jme3.scene.Spatial;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 *  Notified when the current selection changes.
 | 
			
		||||
 *
 | 
			
		||||
 *  @author    Paul Speed
 | 
			
		||||
 */
 | 
			
		||||
public interface SelectionListener {
 | 
			
		||||
 | 
			
		||||
    public void selectionChanged( Spatial selection, Spatial previous );
 | 
			
		||||
}
 | 
			
		||||
@@ -63,6 +63,10 @@ public class Player implements FieldVisitor<Void>{
 | 
			
		||||
        this.handler = handler;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setFigure(Figure figure) {
 | 
			
		||||
        this.figure = figure;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public PlayerColor getColor() {
 | 
			
		||||
        switch ((id%6)+1) {
 | 
			
		||||
            case 1: return PlayerColor.BLUE;
 | 
			
		||||
 
 | 
			
		||||
@@ -19,6 +19,9 @@ import pp.monopoly.message.server.ServerMessage;
 | 
			
		||||
import pp.monopoly.message.server.TradeReply;
 | 
			
		||||
import pp.monopoly.message.server.TradeRequest;
 | 
			
		||||
import pp.monopoly.message.server.ViewAssetsResponse;
 | 
			
		||||
import pp.monopoly.model.Board;
 | 
			
		||||
import pp.monopoly.model.Figure;
 | 
			
		||||
import pp.monopoly.model.Rotation;
 | 
			
		||||
import pp.monopoly.model.fields.BoardManager;
 | 
			
		||||
import pp.monopoly.model.fields.PropertyField;
 | 
			
		||||
 | 
			
		||||
@@ -187,6 +190,8 @@ public class ServerGameLogic implements ClientInterpreter {
 | 
			
		||||
 | 
			
		||||
        if (player != null) {
 | 
			
		||||
            player.setName(msg.getName());
 | 
			
		||||
            player.setFigure(new Figure(1, -10, -10, Rotation.LEFT, msg.getFigure()));
 | 
			
		||||
            //TODO add figure to the map
 | 
			
		||||
            playerHandler.setPlayerReady(player, true);    
 | 
			
		||||
            LOGGER.log(Level.DEBUG, "Player {0} is ready", player.getName());
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -57,7 +57,6 @@ public class Board {
 | 
			
		||||
        this.width = width;
 | 
			
		||||
        this.height = height;
 | 
			
		||||
        this.eventBroker = eventBroker;
 | 
			
		||||
        addItem(new Figure(5, 5, 5, Rotation.LEFT));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -8,6 +8,7 @@ import static java.lang.Math.max;
 | 
			
		||||
import static java.lang.Math.min;
 | 
			
		||||
 | 
			
		||||
public class Figure implements Item{
 | 
			
		||||
    private final String type;
 | 
			
		||||
    private final int length; // The length of the Figure
 | 
			
		||||
    private int x;            // The x-coordinate of the Figure's position
 | 
			
		||||
    private int y;            // The y-coordinate of the Figure's position
 | 
			
		||||
@@ -19,7 +20,7 @@ public class Figure implements Item{
 | 
			
		||||
     * at position (0, 0), with a default rotation of RIGHT.
 | 
			
		||||
     */
 | 
			
		||||
    private Figure() {
 | 
			
		||||
        this(0, 0, 0, Rotation.RIGHT);
 | 
			
		||||
        this(0, 0, 0, Rotation.RIGHT, "cube");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -30,11 +31,12 @@ public class Figure implements Item{
 | 
			
		||||
     * @param y      the y-coordinate of the Figure's initial position
 | 
			
		||||
     * @param rot    the rotation of the Figure
 | 
			
		||||
     */
 | 
			
		||||
    public Figure(int length, int x, int y, Rotation rot) {
 | 
			
		||||
    public Figure(int length, int x, int y, Rotation rot, String type) {
 | 
			
		||||
        this.x = x;
 | 
			
		||||
        this.y = y;
 | 
			
		||||
        this.rot = rot;
 | 
			
		||||
        this.length = length;
 | 
			
		||||
        this.type = type;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@ import com.jme3.math.ColorRGBA;
 | 
			
		||||
/**
 | 
			
		||||
 * Enum representing eight distinct colors for properties in the game.
 | 
			
		||||
 */
 | 
			
		||||
enum FieldColor {
 | 
			
		||||
public enum FieldColor {
 | 
			
		||||
    BROWN(new ColorRGBA(148 / 255f, 86 / 255f, 57 / 255f, 1)),
 | 
			
		||||
    GREEN(new ColorRGBA(30 / 255f, 179 / 255f, 90 / 255f, 1)),
 | 
			
		||||
    YELLOW(new ColorRGBA(252 / 255f, 241 / 255f, 1 / 255f, 1)),
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user