diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/GameAppState.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/GameAppState.java index c474659..916e437 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/GameAppState.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/GameAppState.java @@ -8,14 +8,13 @@ package pp.monopoly.client; import java.lang.System.Logger; -import java.util.List; + +import java.lang.System.Logger.Level; import com.jme3.input.controls.ActionListener; import com.jme3.scene.Node; -import com.jme3.system.AppSettings; import pp.monopoly.client.gui.TestWorld; -import pp.monopoly.game.server.Player; /** * Represents the state responsible for managing the battle interface within the Battleship game. @@ -24,8 +23,6 @@ import pp.monopoly.game.server.Player; */ public class GameAppState extends MonopolyAppState { private static final Logger LOGGER = System.getLogger(MonopolyAppState.class.getName()); - private static final float DEPTH = 0f; - private static final float GAP = 20f; /** * A listener for handling click events in the battle interface. @@ -49,9 +46,9 @@ public class GameAppState extends MonopolyAppState { */ @Override protected void enableState() { + LOGGER.log(Level.DEBUG, "Enabling game state"); battleNode.detachAllChildren(); initializeGuiComponents(); - layoutGuiComponents(); addGuiComponents(); getApp().getGuiNode().attachChild(battleNode); } @@ -85,16 +82,6 @@ public class GameAppState extends MonopolyAppState { private void addGuiComponents() { } - /** - * Lays out the GUI components within the window, positioning them appropriately. - * The opponent's map view is positioned based on the window's dimensions and a specified gap. - */ - private void layoutGuiComponents() { - final AppSettings s = getApp().getContext().getSettings(); - final float windowWidth = s.getWidth(); - final float windowHeight = s.getHeight(); - } - /** * Handles click events in the battle interface. If the event indicates a click (not a release), * it translates the cursor position to the model's coordinate system and triggers the game logic @@ -107,7 +94,6 @@ public class GameAppState extends MonopolyAppState { @Override public void update(float tpf) { - // testWorld.update(tpf); super.update(tpf); } } diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/GameBoardSynchronizer.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/GameBoardSynchronizer.java index f8dd72e..7263a18 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/GameBoardSynchronizer.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/GameBoardSynchronizer.java @@ -37,7 +37,6 @@ class GameBoardSynchronizer extends BoardSynchronizer { private static final String FIGURE = "figure"; //NON-NLS private final MonopolyApp app; - private final ParticleEffectFactory particleFactory; /** * Constructs a {@code GameBoardSynchronizer} object with the specified application, root node, and ship map. @@ -49,7 +48,6 @@ class GameBoardSynchronizer extends BoardSynchronizer { public GameBoardSynchronizer(MonopolyApp app, Node root, Board board) { super(board, root); this.app = app; - this.particleFactory = new ParticleEffectFactory(app); addExisting(); } diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/ParticleEffectFactory.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/ParticleEffectFactory.java deleted file mode 100644 index 790400c..0000000 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/ParticleEffectFactory.java +++ /dev/null @@ -1,22 +0,0 @@ -package pp.monopoly.client.gui; - -import com.jme3.effect.ParticleMesh.Type; - -import pp.monopoly.client.MonopolyApp; - -/** - * Factory class responsible for creating particle effects used in the game. - * This centralizes the creation of various types of particle emitters. - */ -public class ParticleEffectFactory { - private static final int COUNT_FACTOR = 1; - private static final float COUNT_FACTOR_F = 1f; - private static final boolean POINT_SPRITE = true; - private static final Type EMITTER_TYPE = POINT_SPRITE ? Type.Point : Type.Triangle; - - private final MonopolyApp app; - - ParticleEffectFactory(MonopolyApp app) { - this.app = app; - } -} \ No newline at end of file diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/PropertyOverviewMenu.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/PropertyOverviewMenu.java index 8da6069..59d52d8 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/PropertyOverviewMenu.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/PropertyOverviewMenu.java @@ -19,7 +19,6 @@ import pp.monopoly.model.fields.GateField; import pp.monopoly.model.fields.PropertyField; import pp.monopoly.notification.Sound; -import java.text.Collator; import java.util.ArrayList; import java.util.Comparator; import java.util.List; diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java index 3053edb..f55982f 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java @@ -96,16 +96,12 @@ public class Toolbar extends Dialog implements GameEventListener { */ private Button endTurnButton; - /** - * Flag indicating if dice animation is ongoing. - */ - private volatile boolean animatingDice = false; - /** * Stores the most recent dice roll event. */ - private volatile DiceRollEvent latestDiceRollEvent = null; + private DiceRollEvent latestDiceRollEvent = null; + /**Indicates if the bankrupt PopUp has already been shown */ private boolean bankruptPopUp = false; /** @@ -305,18 +301,12 @@ public class Toolbar extends Dialog implements GameEventListener { return endTurnButton; } - private QuadBackgroundComponent createBackground() { - return new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)); - } - private void startDiceAnimation() { - animatingDice = true; long startTime = System.currentTimeMillis(); new Thread(() -> { try { animateDice(startTime); - animatingDice = false; if (latestDiceRollEvent != null) { showFinalDiceResult(latestDiceRollEvent); } diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar2.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar2.java deleted file mode 100644 index bc86e17..0000000 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar2.java +++ /dev/null @@ -1,168 +0,0 @@ -package pp.monopoly.client.gui; - -import java.util.Random; - -import com.jme3.font.BitmapText; -import com.jme3.math.Vector3f; -import com.jme3.scene.Geometry; -import com.simsilica.lemur.Axis; -import com.simsilica.lemur.Button; -import com.simsilica.lemur.Container; -import com.simsilica.lemur.component.SpringGridLayout; - -import pp.monopoly.client.MonopolyApp; - -/** - * Toolbar Klasse, die am unteren Rand der Szene angezeigt wird. - * Die Buttons bewegen den Würfel auf dem Spielfeld. - */ -public class Toolbar2 { - - private final MonopolyApp app; - private final Container toolbarContainer; - private final Geometry cube; // Referenz auf den Würfel - private final BitmapText positionText; // Anzeige für die aktuelle Position - private final float boardLimit = 0.95f; // Grenzen des Bretts - private final float stepSize = 0.18f; // Schrittgröße pro Bewegung - private int currentPosition = 0; // Aktuelle Position auf dem Spielfeld - private final int positionsPerSide = 10; // Anzahl der Positionen pro Seite - private final Random random = new Random(); // Zufallsgenerator für den Würfelwurf - - /** - * Konstruktor für die Toolbar. - * - * @param app Die Hauptanwendung (MonopolyApp) - * @param cube Der Würfel, der bewegt werden soll - */ - public Toolbar2(MonopolyApp app, Geometry cube) { - this.app = app; - this.cube = cube; - - // Erstelle die Toolbar - toolbarContainer = new Container(new SpringGridLayout(Axis.X, Axis.Y)); - - // Setze die Position am unteren Rand und die Breite - toolbarContainer.setLocalTranslation( - 0, // Links bündig - 100, // Höhe über dem unteren Rand - 0 // Z-Ebene - ); - toolbarContainer.setPreferredSize(new Vector3f(app.getCamera().getWidth(), 100, 0)); // Volle Breite - - // Füge Buttons zur Toolbar hinzu - initializeButtons(); - - // Füge die Toolbar zur GUI hinzu - app.getGuiNode().attachChild(toolbarContainer); - - // Erstelle die Position-Anzeige - positionText = createPositionDisplay(); - updatePositionDisplay(); // Initialisiere die Anzeige mit der Startposition - } - - /** - * Initialisiert die Buttons in der Toolbar. - */ - private void initializeButtons() { - addButton("Vorwärts", 1); // Bewegung nach vorne - addButton("Rückwärts", -1); // Bewegung nach hinten - addDiceRollButton(); // Würfel-Button - } - - /** - * Fügt einen Button mit einer Bewegung hinzu. - * - * @param label Der Text des Buttons - * @param step Schrittweite (+1 für vorwärts, -1 für rückwärts) - */ - private void addButton(String label, int step) { - Button button = new Button(label); - button.setPreferredSize(new Vector3f(150, 50, 0)); // Größe der Buttons - button.addClickCommands(source -> moveCube(step)); - toolbarContainer.addChild(button); - } - - /** - * Fügt den Würfel-Button hinzu, der die Figur entsprechend der gewürfelten Zahl bewegt. - */ - private void addDiceRollButton() { - Button diceButton = new Button("Würfeln"); - diceButton.setPreferredSize(new Vector3f(150, 50, 0)); // Größe des Buttons - diceButton.addClickCommands(source -> rollDice()); - toolbarContainer.addChild(diceButton); - } - - /** - * Simuliert einen Würfelwurf und bewegt die Figur entsprechend. - */ - private void rollDice() { - int diceRoll = random.nextInt(6) + 1; // Zahl zwischen 1 und 6 - System.out.println("Gewürfelt: " + diceRoll); - moveCube(diceRoll); // Bewege die Figur um die gewürfelte Zahl - } - - /** - * Bewegt den Würfel basierend auf der aktuellen Position auf dem Brett. - * - * @param step Schrittweite (+1 für vorwärts, -1 für rückwärts oder andere Werte) - */ - private void moveCube(int step) { - currentPosition = (currentPosition + step + 4 * positionsPerSide) % (4 * positionsPerSide); - Vector3f newPosition = calculatePosition(currentPosition); - cube.setLocalTranslation(newPosition); - updatePositionDisplay(); // Aktualisiere die Positionsanzeige - System.out.println("Würfelposition: " + newPosition + " (Feld-ID: " + currentPosition + ")"); - } - - /** - * Berechnet die neue Position des Würfels basierend auf der aktuellen Brettseite und Position. - * - * @param position Aktuelle Position auf dem Spielfeld - * @return Die berechnete Position als Vector3f - */ - private Vector3f calculatePosition(int position) { - int side = position / positionsPerSide; // Seite des Bretts (0 = unten, 1 = rechts, 2 = oben, 3 = links) - int offset = position % positionsPerSide; // Position auf der aktuellen Seite - - switch (side) { - case 0: // Unten (positive x-Achse) - return new Vector3f(-boardLimit + offset * stepSize, 0.1f, -boardLimit + 0.05f); - case 1: // Rechts (positive z-Achse) - return new Vector3f(boardLimit - 0.05f, 0.1f, -boardLimit + offset * stepSize); - case 2: // Oben (negative x-Achse) - return new Vector3f(boardLimit - offset * stepSize, 0.1f, boardLimit - 0.05f); - case 3: // Links (negative z-Achse) - return new Vector3f(-boardLimit + 0.05f, 0.1f, boardLimit - offset * stepSize); - default: - throw new IllegalArgumentException("Ungültige Position: " + position); - } - } - - /** - * Erstellt die Anzeige für die aktuelle Position. - * - * @return Das BitmapText-Objekt für die Anzeige - */ - private BitmapText createPositionDisplay() { - BitmapText text = new BitmapText(app.getAssetManager().loadFont("Interface/Fonts/Default.fnt"), false); - text.setSize(20); // Schriftgröße - text.setLocalTranslation(10, app.getCamera().getHeight() - 10, 0); // Oben links - app.getGuiNode().attachChild(text); - return text; - } - - /** - * Aktualisiert die Anzeige für die aktuelle Position. - */ - private void updatePositionDisplay() { - positionText.setText("Feld-ID: " + currentPosition); - } - - /** - * Entfernt die Toolbar. - */ - public void remove() { - app.getGuiNode().detachChild(toolbarContainer); - app.getGuiNode().detachChild(positionText); - } -} diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TradeMenu.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TradeMenu.java index db55633..4abf116 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TradeMenu.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TradeMenu.java @@ -12,7 +12,6 @@ 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 com.simsilica.lemur.text.DocumentModel; import pp.dialog.Dialog; import pp.monopoly.client.MonopolyApp; @@ -55,7 +54,6 @@ public class TradeMenu extends Dialog { private TextField leftCurrencyInput, rightCurrencyInput; private VersionedReference> leftBuildingRef, rightBuildingRef; - private VersionedReference leftCurrencyRef, rightCurrencyRef; private VersionedReference> leftCardRef, rightCardRef; private Set rightselBuildings = new HashSet<>(); @@ -339,11 +337,9 @@ public class TradeMenu extends Dialog { private void initializeReferences() { leftBuildingRef = leftBuildingSelector.getSelectionModel().createReference(); leftCardRef = leftSpecialCardSelector.getSelectionModel().createReference(); - leftCurrencyRef = leftCurrencyInput.getDocumentModel().createReference(); rightBuildingRef = rightBuildingSelector.getSelectionModel().createReference(); rightCardRef = rightSpecialCardSelector.getSelectionModel().createReference(); - rightCurrencyRef = rightCurrencyInput.getDocumentModel().createReference(); } /** diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/ConfirmTrade.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/ConfirmTrade.java index 438c39e..6d6e835 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/ConfirmTrade.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/ConfirmTrade.java @@ -11,7 +11,6 @@ import pp.monopoly.client.MonopolyApp; import pp.monopoly.client.gui.SettingsMenu; import pp.monopoly.client.gui.TradeMenu; import pp.monopoly.message.client.TradeResponse; -import pp.monopoly.message.server.TradeReply; import pp.monopoly.model.TradeHandler; import pp.monopoly.model.fields.PropertyField; import pp.monopoly.notification.Sound; diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/EventCardPopup.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/EventCardPopup.java index dfd3bc6..cd91944 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/EventCardPopup.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/EventCardPopup.java @@ -31,8 +31,6 @@ public class EventCardPopup extends Dialog { /** Background container providing a border for the popup. */ private final Container backgroundContainer; - /** The description of the event card. */ - private final String description; /** * Constructs the EventCardPopup to display the details of a triggered event card. @@ -43,7 +41,6 @@ public class EventCardPopup extends Dialog { public EventCardPopup(MonopolyApp app, String description) { super(app.getDialogManager()); this.app = app; - this.description = description; // Halbtransparentes Overlay hinzufügen overlayBackground = createOverlayBackground(); diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/GateFieldCard.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/GateFieldCard.java index 7f01ff2..6a4400f 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/GateFieldCard.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/GateFieldCard.java @@ -1,10 +1,6 @@ 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; @@ -109,22 +105,6 @@ public class GateFieldCard extends Dialog { app.getGuiNode().attachChild(gateFieldContainer); } - /** - * Creates a semi-transparent background overlay for the popup. - * - * @return the geometry of the overlay - */ - 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; - } - /** * Closes the popup and removes its associated GUI elements. */ diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/SellHouse.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/SellHouse.java index bfe9e6b..5d6d866 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/SellHouse.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/SellHouse.java @@ -1,17 +1,13 @@ package pp.monopoly.client.gui.popups; import com.jme3.math.ColorRGBA; -import com.jme3.math.Vector2f; import com.jme3.math.Vector3f; import com.simsilica.lemur.Axis; import com.simsilica.lemur.Button; -import com.simsilica.lemur.Checkbox; import com.simsilica.lemur.Container; import com.simsilica.lemur.Label; -import com.simsilica.lemur.ListBox; import com.simsilica.lemur.Selector; import com.simsilica.lemur.TextField; -import com.simsilica.lemur.component.IconComponent; import com.simsilica.lemur.component.QuadBackgroundComponent; import com.simsilica.lemur.component.SpringGridLayout; import com.simsilica.lemur.core.VersionedList; diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/TakeMortage.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/TakeMortage.java index d3cceb0..a852515 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/TakeMortage.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/TakeMortage.java @@ -21,7 +21,6 @@ import pp.monopoly.message.client.AlterProperty; import pp.monopoly.model.fields.BoardManager; import pp.monopoly.model.fields.BuildingProperty; import pp.monopoly.model.fields.PropertyField; -import pp.monopoly.model.fields.PropertyField; import pp.monopoly.notification.Sound; import java.util.HashSet; diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/TimeOut.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/TimeOut.java index 3047f96..798f2ab 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/TimeOut.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/TimeOut.java @@ -14,7 +14,6 @@ import com.simsilica.lemur.style.ElementId; import pp.dialog.Dialog; import pp.monopoly.client.MonopolyApp; import pp.monopoly.notification.Sound; -import static pp.monopoly.Resources.lookup; /** * TimeOut is a warning popup triggered when the connection to the server is interrupted. diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java index 6b1cf29..83659c9 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java @@ -246,7 +246,7 @@ public class Player implements FieldVisitor{ */ public void sellProperty(PropertyField property) { if (property.getOwner() == this) { - properties.remove(property); + properties.remove(property.getId()); property.setOwner(null); } } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java index dbe8b02..5c2da6d 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java @@ -4,9 +4,7 @@ import java.lang.System.Logger; import java.lang.System.Logger.Level; import java.util.HashSet; import java.util.List; -import java.util.Properties; import java.util.Set; -import java.util.stream.Collector; import java.util.stream.Collectors; import pp.monopoly.MonopolyConfig; @@ -212,7 +210,6 @@ public class ServerGameLogic implements ClientInterpreter { String truc = name.length() > 10 ? name.substring(0, 15) : name; player.setName(truc); 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()); } @@ -427,15 +424,14 @@ public class ServerGameLogic implements ClientInterpreter { @Override public void received(NotificationAnswer msg, int from) { - if(msg.getA().equals("UseJailCard")) { + if(msg.getKeyword().equals("UseJailCard")) { playerHandler.getPlayerById(from).useJailCard(); - } else if (msg.getA().equals("PayJail")) { + } else if (msg.getKeyword().equals("PayJail")) { playerHandler.getPlayerById(from).payBail(); - } else if(msg.getA().equals("hack")) { - // for (BuildingProperty bp : boardManager.getPropertyFields( List.of(1,3)).stream().filter(p -> p instanceof BuildingProperty).map(p -> (BuildingProperty) p).collect(Collectors.toList())) { - // bp.setOwner(playerHandler.getPlayerById(0)); - // playerHandler.getPlayerById(0).addProperty(bp.getId()); - // } + } else if(msg.getKeyword().equals("hack")) { + for (BuildingProperty bp : boardManager.getPropertyFields( List.of(1,3)).stream().filter(p -> p instanceof BuildingProperty).map(p -> (BuildingProperty) p).collect(Collectors.toList())) { + bp.build(); + } for(PropertyField field : boardManager.getBoard().stream().filter(p -> p instanceof PropertyField).map(p -> (PropertyField) p).collect(Collectors.toList())) { field.setOwner(playerHandler.getPlayerById(0)); playerHandler.getPlayerById(0).addProperty(field.getId()); diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/client/NotificationAnswer.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/client/NotificationAnswer.java index 6f0efda..a48033f 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/client/NotificationAnswer.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/client/NotificationAnswer.java @@ -5,16 +5,16 @@ import com.jme3.network.serializing.Serializable; @Serializable public class NotificationAnswer extends ClientMessage{ - private String A; + private String keyword; private NotificationAnswer() {} - public NotificationAnswer(String A) { - this.A = A; + public NotificationAnswer(String keyword) { + this.keyword = keyword; } - public String getA() { - return A; + public String getKeyword() { + return keyword; } @Override diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/BuyPropertyRequest.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/BuyPropertyRequest.java index b348586..5384a93 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/BuyPropertyRequest.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/BuyPropertyRequest.java @@ -11,11 +11,4 @@ public class BuyPropertyRequest extends ServerMessage{ public void accept(ServerInterpreter interpreter) { interpreter.received(this); } - - @Override - public String getInfoTextKey() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getInfoTextKey'"); - } - } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/DiceResult.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/DiceResult.java index 864a347..b958c8c 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/DiceResult.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/DiceResult.java @@ -32,12 +32,6 @@ public class DiceResult extends ServerMessage{ interpreter.received(this); } - @Override - public String getInfoTextKey() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getInfoTextKey'"); - } - public boolean isDoublets() { return a == b; } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/EventDrawCard.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/EventDrawCard.java index 929ac6e..fa7c162 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/EventDrawCard.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/EventDrawCard.java @@ -20,12 +20,6 @@ public class EventDrawCard extends ServerMessage{ interpreter.received(this); } - @Override - public String getInfoTextKey() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getInfoTextKey'"); - } - public String getCardDescription() { return cardDescription; } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/GameOver.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/GameOver.java index 91de2fc..9fdcb80 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/GameOver.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/GameOver.java @@ -24,10 +24,4 @@ public class GameOver extends ServerMessage{ interpreter.received(this); } - @Override - public String getInfoTextKey() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getInfoTextKey'"); - } - } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/GameStart.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/GameStart.java index 45ea0b3..7d65ce6 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/GameStart.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/GameStart.java @@ -27,10 +27,4 @@ public class GameStart extends ServerMessage{ interpreter.received(this); } - @Override - public String getInfoTextKey() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getInfoTextKey'"); - } - } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/JailEvent.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/JailEvent.java index 9996545..4a808a2 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/JailEvent.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/JailEvent.java @@ -25,10 +25,4 @@ public class JailEvent extends ServerMessage{ interpreter.received(this); } - @Override - public String getInfoTextKey() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getInfoTextKey'"); - } - } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/NextPlayerTurn.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/NextPlayerTurn.java index b2e5c85..6659e42 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/NextPlayerTurn.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/NextPlayerTurn.java @@ -15,10 +15,5 @@ public class NextPlayerTurn extends ServerMessage{ public void accept(ServerInterpreter interpreter) { interpreter.received(this); } - - @Override - public String getInfoTextKey() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getInfoTextKey'"); - } + } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/NotificationMessage.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/NotificationMessage.java index 5713875..6cbcbb3 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/NotificationMessage.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/NotificationMessage.java @@ -41,10 +41,4 @@ public class NotificationMessage extends ServerMessage{ interpreter.received(this); } - @Override - public String getInfoTextKey() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getInfoTextKey'"); - } - } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/PlayerStatusUpdate.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/PlayerStatusUpdate.java index e6cc7bf..78fdda6 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/PlayerStatusUpdate.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/PlayerStatusUpdate.java @@ -27,10 +27,4 @@ public class PlayerStatusUpdate extends ServerMessage{ interpreter.received(this); } - @Override - public String getInfoTextKey() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getInfoTextKey'"); - } - } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/ServerMessage.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/ServerMessage.java index 49d7bab..3ffeece 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/ServerMessage.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/ServerMessage.java @@ -28,12 +28,4 @@ public abstract class ServerMessage extends AbstractMessage { * @param interpreter the visitor to be used for processing */ public abstract void accept(ServerInterpreter interpreter); - - /** - * Gets the bundle key of the informational text to be shown at the client. - * This key is used to retrieve the appropriate localized text for display. - * - * @return the bundle key of the informational text - */ - public abstract String getInfoTextKey(); } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/TimeOutWarning.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/TimeOutWarning.java index 684ee2a..0635640 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/TimeOutWarning.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/TimeOutWarning.java @@ -25,10 +25,4 @@ public class TimeOutWarning extends ServerMessage{ interpreter.received(this); } - @Override - public String getInfoTextKey() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getInfoTextKey'"); - } - } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/TradeReply.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/TradeReply.java index 8f4edd1..c2e33fc 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/TradeReply.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/TradeReply.java @@ -38,10 +38,4 @@ public class TradeReply extends ServerMessage{ interpreter.received(this); } - @Override - public String getInfoTextKey() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getInfoTextKey'"); - } - } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/TradeRequest.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/TradeRequest.java index 16df203..097f193 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/TradeRequest.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/TradeRequest.java @@ -34,10 +34,4 @@ public class TradeRequest extends ServerMessage{ interpreter.received(this); } - @Override - public String getInfoTextKey() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getInfoTextKey'"); - } - } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/ViewAssetsResponse.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/ViewAssetsResponse.java index 301547e..6098351 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/ViewAssetsResponse.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/ViewAssetsResponse.java @@ -32,13 +32,8 @@ public class ViewAssetsResponse extends ServerMessage{ interpreter.received(this); } - @Override - public String getInfoTextKey() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getInfoTextKey'"); - } - public BoardManager getboard() { return board; } + } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/Rotation.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/Rotation.java index 37bfab0..39d95c1 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/Rotation.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/Rotation.java @@ -7,11 +7,11 @@ package pp.monopoly.model; -import java.io.Serializable; - /** * Represents the rotation of a Item and provides functionality related to rotation. */ +import java.io.Serializable; + public enum Rotation implements Serializable { /** * Represents the item facing upwards.