mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-19 00:06:16 +01:00
Merge branch 'gui' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02 into gui
This commit is contained in:
commit
e49b22c022
@ -0,0 +1,60 @@
|
|||||||
|
//package pp.monopoly.client.gui;
|
||||||
|
//
|
||||||
|
//import com.jme3.input.InputManager;
|
||||||
|
//import com.jme3.input.KeyInput;
|
||||||
|
//import com.jme3.input.controls.ActionListener;
|
||||||
|
//import com.jme3.input.controls.KeyTrigger;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * Handhabt die Eingaben für die Kamera.
|
||||||
|
// */
|
||||||
|
//public class CameraInputHandler {
|
||||||
|
//
|
||||||
|
// private CameraController cameraController; // Kamera-Controller
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * Konstruktor für den CameraInputHandler.
|
||||||
|
// *
|
||||||
|
// * @param cameraController Der Kamera-Controller, der gesteuert werden soll.
|
||||||
|
// * @param inputManager Der InputManager, um Eingaben zu registrieren.
|
||||||
|
// */
|
||||||
|
// public CameraInputHandler(CameraController cameraController, InputManager inputManager) {
|
||||||
|
// if (cameraController == null || inputManager == null) {
|
||||||
|
// throw new IllegalArgumentException("CameraController und InputManager dürfen nicht null sein");
|
||||||
|
// }
|
||||||
|
// this.cameraController = cameraController;
|
||||||
|
//
|
||||||
|
// // Mappings für Kamerasteuerung
|
||||||
|
// inputManager.addMapping("FocusCurrentPlayer", new KeyTrigger(KeyInput.KEY_1)); // Modus 1
|
||||||
|
// inputManager.addMapping("FocusSelf", new KeyTrigger(KeyInput.KEY_2)); // Modus 2
|
||||||
|
// inputManager.addMapping("FreeCam", new KeyTrigger(KeyInput.KEY_3)); // Modus 3
|
||||||
|
//
|
||||||
|
// // Listener für die Kameramodi
|
||||||
|
// inputManager.addListener(actionListener, "FocusCurrentPlayer", "FocusSelf", "FreeCam");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * ActionListener für die Kamerasteuerung.
|
||||||
|
// */
|
||||||
|
// private final ActionListener actionListener = (name, isPressed, tpf) -> {
|
||||||
|
// if (!isPressed) return;
|
||||||
|
//
|
||||||
|
// // Umschalten der Kamera-Modi basierend auf der Eingabe
|
||||||
|
// switch (name) {
|
||||||
|
// case "FocusCurrentPlayer" -> {
|
||||||
|
// cameraController.setMode(CameraController.CameraMode.FOCUS_CURRENT_PLAYER);
|
||||||
|
// System.out.println("Kameramodus: Fokus auf aktuellen Spieler");
|
||||||
|
// }
|
||||||
|
// case "FocusSelf" -> {
|
||||||
|
// cameraController.setMode(CameraController.CameraMode.FOCUS_SELF);
|
||||||
|
// System.out.println("Kameramodus: Fokus auf eigene Figur");
|
||||||
|
// }
|
||||||
|
// case "FreeCam" -> {
|
||||||
|
// cameraController.setMode(CameraController.CameraMode.FREECAM);
|
||||||
|
// System.out.println("Kameramodus: Freie Kamera");
|
||||||
|
// }
|
||||||
|
// default -> System.err.println("Unbekannter Kameramodus: " + name);
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
//}
|
||||||
|
//
|
@ -23,6 +23,7 @@ import pp.monopoly.notification.Sound;
|
|||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the trade menu dialog in the Monopoly application.
|
* Represents the trade menu dialog in the Monopoly application.
|
||||||
* <p>
|
* <p>
|
||||||
@ -45,7 +46,7 @@ public class TradeMenu extends Dialog {
|
|||||||
private Geometry background;
|
private Geometry background;
|
||||||
private Selector<String> leftBuildingSelector, leftSpecialCardSelector;
|
private Selector<String> leftBuildingSelector, leftSpecialCardSelector;
|
||||||
private Selector<String> rightBuildingSelector, rightSpecialCardSelector;
|
private Selector<String> rightBuildingSelector, rightSpecialCardSelector;
|
||||||
private TextField leftSelectionsField, rightSelectionsField;
|
private Label leftSelectionsLabel, rightSelectionsLabel;
|
||||||
private TextField leftCurrencyInput, rightCurrencyInput;
|
private TextField leftCurrencyInput, rightCurrencyInput;
|
||||||
|
|
||||||
private VersionedReference<Set<Integer>> leftBuildingRef, rightBuildingRef;
|
private VersionedReference<Set<Integer>> leftBuildingRef, rightBuildingRef;
|
||||||
@ -217,12 +218,14 @@ public class TradeMenu extends Dialog {
|
|||||||
Container middleSection = new Container(new SpringGridLayout(Axis.Y, Axis.X));
|
Container middleSection = new Container(new SpringGridLayout(Axis.Y, Axis.X));
|
||||||
middleSection.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8f, 0.8f, 0.8f, 1.0f)));
|
middleSection.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8f, 0.8f, 0.8f, 1.0f)));
|
||||||
|
|
||||||
Label middleLabelTop = middleSection.addChild(new Label("Gebäude: Währung: Sonderkarten:"));
|
Label middleLabelTop = middleSection.addChild(new Label("Meine Gebäude:"));
|
||||||
middleLabelTop.setFontSize(24);
|
middleLabelTop.setFontSize(24);
|
||||||
|
middleLabelTop.setTextVAlignment(VAlignment.Center);
|
||||||
|
middleLabelTop.setTextHAlignment(HAlignment.Center);
|
||||||
middleLabelTop.setInsets(new Insets3f(5, 5, 5, 5));
|
middleLabelTop.setInsets(new Insets3f(5, 5, 5, 5));
|
||||||
|
|
||||||
leftSelectionsField = middleSection.addChild(new TextField(""));
|
leftSelectionsLabel = middleSection.addChild(new Label(""));
|
||||||
leftSelectionsField.setPreferredSize(new Vector3f(600, 50, 0));
|
leftSelectionsLabel.setPreferredSize(new Vector3f(600, 50, 0));
|
||||||
|
|
||||||
Container buttons = middleSection.addChild(new Container(new SpringGridLayout()));
|
Container buttons = middleSection.addChild(new Container(new SpringGridLayout()));
|
||||||
Button cancel = new Button("Abbrechen");
|
Button cancel = new Button("Abbrechen");
|
||||||
@ -242,12 +245,14 @@ public class TradeMenu extends Dialog {
|
|||||||
buttons.addChild(cancel);
|
buttons.addChild(cancel);
|
||||||
buttons.addChild(trade);
|
buttons.addChild(trade);
|
||||||
|
|
||||||
Label middleLabelBottom = middleSection.addChild(new Label("Gebäude: Währung: Sonderkarten:"));
|
Label middleLabelBottom = middleSection.addChild(new Label("Gebäude des Gegenspielers:"));
|
||||||
middleLabelBottom.setFontSize(24);
|
middleLabelBottom.setFontSize(24);
|
||||||
|
middleLabelBottom.setTextVAlignment(VAlignment.Center);
|
||||||
|
middleLabelBottom.setTextHAlignment(HAlignment.Center);
|
||||||
middleLabelBottom.setInsets(new Insets3f(5, 5, 5, 5));
|
middleLabelBottom.setInsets(new Insets3f(5, 5, 5, 5));
|
||||||
|
|
||||||
rightSelectionsField = middleSection.addChild(new TextField(""));
|
rightSelectionsLabel = middleSection.addChild(new Label(""));
|
||||||
rightSelectionsField.setPreferredSize(new Vector3f(600, 50, 0));
|
rightSelectionsLabel.setPreferredSize(new Vector3f(600, 50, 0));
|
||||||
return middleSection;
|
return middleSection;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,25 +326,23 @@ public class TradeMenu extends Dialog {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void update(float delta) {
|
public void update(float delta) {
|
||||||
if (leftBuildingRef.update() || leftCardRef.update() || leftCurrencyRef.update()) {
|
if (leftBuildingRef.update() || leftCardRef.update()) {
|
||||||
updateSelections(leftSelectionsField, leftBuildingSelector, leftCurrencyInput, leftSpecialCardSelector, true);
|
updateSelections(leftSelectionsLabel, leftBuildingSelector, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rightBuildingRef.update() || rightCardRef.update() || rightCurrencyRef.update()) {
|
if (rightBuildingRef.update() || rightCardRef.update()) {
|
||||||
updateSelections(rightSelectionsField, rightBuildingSelector, rightCurrencyInput, rightSpecialCardSelector, false);
|
updateSelections(rightSelectionsLabel, rightBuildingSelector, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the displayed selections for properties, currency, and cards.
|
* Updates the displayed selections for properties.
|
||||||
*
|
*
|
||||||
* @param target the target text field to update
|
* @param target the target label to update
|
||||||
* @param building the building selector
|
* @param building the building selector
|
||||||
* @param currency the currency input field
|
|
||||||
* @param card the special card selector
|
|
||||||
* @param isLeft true if updating the left column; false otherwise
|
* @param isLeft true if updating the left column; false otherwise
|
||||||
*/
|
*/
|
||||||
private void updateSelections(TextField target, Selector<String> building, TextField currency, Selector<String> card, boolean isLeft) {
|
private void updateSelections(Label target, Selector<String> building, boolean isLeft) {
|
||||||
StringBuilder buildingText = new StringBuilder();
|
StringBuilder buildingText = new StringBuilder();
|
||||||
if (isLeft) {
|
if (isLeft) {
|
||||||
if (leftselBuildings.contains(building.getSelectedItem())) {
|
if (leftselBuildings.contains(building.getSelectedItem())) {
|
||||||
@ -347,8 +350,8 @@ public class TradeMenu extends Dialog {
|
|||||||
} else {
|
} else {
|
||||||
leftselBuildings.add(building.getSelectedItem()); // Add if not already selected
|
leftselBuildings.add(building.getSelectedItem()); // Add if not already selected
|
||||||
}
|
}
|
||||||
for (String property : leftselBuildings) {
|
for (String property : leftselBuildings) {
|
||||||
buildingText.append(property);
|
buildingText.append(property).append(", ");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (rightselBuildings.contains(building.getSelectedItem())) {
|
if (rightselBuildings.contains(building.getSelectedItem())) {
|
||||||
@ -356,14 +359,12 @@ public class TradeMenu extends Dialog {
|
|||||||
} else {
|
} else {
|
||||||
rightselBuildings.add(building.getSelectedItem()); // Add if not already selected
|
rightselBuildings.add(building.getSelectedItem()); // Add if not already selected
|
||||||
}
|
}
|
||||||
for (String property : rightselBuildings) {
|
for (String property : rightselBuildings) {
|
||||||
buildingText.append(property);
|
buildingText.append(property).append(", ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String currencyText = currency.getText() != null ? currency.getText().trim() : "";
|
target.setText(buildingText.toString().replaceAll(", $", ""));
|
||||||
String cardText = card.getSelectedItem() != null ? card.getSelectedItem() : "";
|
|
||||||
target.setText(String.join(" | ", buildingText, currencyText, cardText));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Opens the settings menu when the escape key is pressed. */
|
/** Opens the settings menu when the escape key is pressed. */
|
||||||
|
@ -73,7 +73,7 @@ public class AcceptTrade extends Dialog {
|
|||||||
|
|
||||||
// Text, der im Popup steht
|
// Text, der im Popup steht
|
||||||
Container textContainer = noMoneyWarningContainer.addChild(new Container());
|
Container textContainer = noMoneyWarningContainer.addChild(new Container());
|
||||||
textContainer.addChild(new Label("Du hast Spieler"+ msg.getTradeHandler().getReceiver().getName() + "einen Handel vorgeschlagen", new ElementId("label-Text")));
|
textContainer.addChild(new Label("Du hast Spieler"+ " " + msg.getTradeHandler().getReceiver().getName() + " " + "einen Handel vorgeschlagen", new ElementId("label-Text")));
|
||||||
textContainer.addChild(new Label("", new ElementId("label-Text")));
|
textContainer.addChild(new Label("", new ElementId("label-Text")));
|
||||||
textContainer.addChild(new Label("Der Handel wurde angenommen", new ElementId("label-Text")));
|
textContainer.addChild(new Label("Der Handel wurde angenommen", new ElementId("label-Text")));
|
||||||
textContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
textContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
||||||
|
@ -70,19 +70,18 @@ public class ConfirmTrade extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Text, der auf der Karte steht
|
// Text, der auf der Karte steht
|
||||||
// Die Werte werden dem Handel entnommen (Iwas auch immer da dann ist)
|
|
||||||
Container propertyValuesContainer = confirmTradeContainer.addChild(new Container());
|
Container propertyValuesContainer = confirmTradeContainer.addChild(new Container());
|
||||||
propertyValuesContainer.addChild(new Label("„Spieler " + tradeHandler.getSender().getName() + " möchte:", new ElementId("label-Text")));
|
propertyValuesContainer.addChild(new Label("„Spieler " + " " + tradeHandler.getSender().getName() + " " +" möchte:", new ElementId("label-Text")));
|
||||||
propertyValuesContainer.addChild(new Label("", new ElementId("label-Text")));// Leerzeile
|
propertyValuesContainer.addChild(new Label("", new ElementId("label-Text")));// Leerzeile
|
||||||
propertyValuesContainer.addChild(new Label("- " + offeredProperties, new ElementId("label-Text")));
|
propertyValuesContainer.addChild(new Label("- " + offeredProperties, new ElementId("label-Text")));
|
||||||
propertyValuesContainer.addChild(new Label("- " + tradeHandler.getOfferedAmount() + " EUR", new ElementId("label-Text")));
|
propertyValuesContainer.addChild(new Label("- " + tradeHandler.getOfferedAmount() + " EUR", new ElementId("label-Text")));
|
||||||
propertyValuesContainer.addChild(new Label("- " + tradeHandler.getOfferedJailCards() +" Sonderkaten", new ElementId("label-Text")));
|
propertyValuesContainer.addChild(new Label("- " + tradeHandler.getOfferedJailCards() +" Sonderkarten", new ElementId("label-Text")));
|
||||||
propertyValuesContainer.addChild(new Label("", new ElementId("label-Text")));// Leerzeile
|
propertyValuesContainer.addChild(new Label("", new ElementId("label-Text")));// Leerzeile
|
||||||
propertyValuesContainer.addChild(new Label("gegen:", new ElementId("label-Text")));
|
propertyValuesContainer.addChild(new Label("gegen:", new ElementId("label-Text")));
|
||||||
propertyValuesContainer.addChild(new Label("", new ElementId("label-Text")));// Leerzeile
|
propertyValuesContainer.addChild(new Label("", new ElementId("label-Text")));// Leerzeile
|
||||||
propertyValuesContainer.addChild(new Label("- "+ requestedProperties, new ElementId("label-Text")));
|
propertyValuesContainer.addChild(new Label("- "+ requestedProperties, new ElementId("label-Text")));
|
||||||
propertyValuesContainer.addChild(new Label("- "+ tradeHandler.getRequestedAmount() +" EUR", new ElementId("label-Text")));
|
propertyValuesContainer.addChild(new Label("- "+ tradeHandler.getRequestedAmount() +" EUR", new ElementId("label-Text")));
|
||||||
propertyValuesContainer.addChild(new Label("- "+ tradeHandler.getRequestedJailCards() +" Sonderkaten", new ElementId("label-Text")));
|
propertyValuesContainer.addChild(new Label("- "+ tradeHandler.getRequestedJailCards() +" Sonderkarten", new ElementId("label-Text")));
|
||||||
propertyValuesContainer.addChild(new Label("", new ElementId("label-Text")));// Leerzeile
|
propertyValuesContainer.addChild(new Label("", new ElementId("label-Text")));// Leerzeile
|
||||||
propertyValuesContainer.addChild(new Label("tauschen, willst du das Angebot annehmen?", new ElementId("label-Text")));
|
propertyValuesContainer.addChild(new Label("tauschen, willst du das Angebot annehmen?", 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)));
|
||||||
|
@ -107,7 +107,7 @@ public class ReceivedRent extends Dialog {
|
|||||||
|
|
||||||
// Rent message
|
// Rent message
|
||||||
Container textContainer = container.addChild(new Container());
|
Container textContainer = container.addChild(new Container());
|
||||||
textContainer.addChild(new Label("Du bekommst von Spieler " + playerName + " " + amount + " EUR Miete",
|
textContainer.addChild(new Label("Du bekommst von Spieler " + " " + playerName + " " + amount + " EUR Miete",
|
||||||
new ElementId("label-Text")));
|
new ElementId("label-Text")));
|
||||||
textContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
textContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
||||||
textContainer.setPreferredSize(container.getPreferredSize().addLocal(-250, -200, 0));
|
textContainer.setPreferredSize(container.getPreferredSize().addLocal(-250, -200, 0));
|
||||||
|
@ -74,7 +74,7 @@ public class RejectTrade extends Dialog {
|
|||||||
|
|
||||||
// Text, der im Popup steht
|
// Text, der im Popup steht
|
||||||
Container textContainer = noMoneyWarningContainer.addChild(new Container());
|
Container textContainer = noMoneyWarningContainer.addChild(new Container());
|
||||||
textContainer.addChild(new Label("Du hast Spieler"+ msg.getTradeHandler().getReceiver().getName() + "einen Handel vorgeschlagen", new ElementId("label-Text")));
|
textContainer.addChild(new Label("Du hast Spieler"+ " " + msg.getTradeHandler().getReceiver().getName() + " " + "einen Handel vorgeschlagen", new ElementId("label-Text")));
|
||||||
textContainer.addChild(new Label("", new ElementId("label-Text")));
|
textContainer.addChild(new Label("", new ElementId("label-Text")));
|
||||||
textContainer.addChild(new Label("Der Handel wurde abgelehnt", new ElementId("label-Text")));
|
textContainer.addChild(new Label("Der Handel wurde abgelehnt", new ElementId("label-Text")));
|
||||||
textContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
textContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
||||||
|
@ -107,7 +107,7 @@ public class Rent extends Dialog {
|
|||||||
|
|
||||||
// Rent message
|
// Rent message
|
||||||
Container textContainer = container.addChild(new Container());
|
Container textContainer = container.addChild(new Container());
|
||||||
textContainer.addChild(new Label("Du musst Spieler " + playerName + " " + amount + " EUR Miete zahlen",
|
textContainer.addChild(new Label("Du musst Spieler " + " " + playerName + " " + amount + " EUR Miete zahlen",
|
||||||
new ElementId("label-Text")));
|
new ElementId("label-Text")));
|
||||||
textContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
textContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
||||||
textContainer.setPreferredSize(container.getPreferredSize().addLocal(-250, -200, 0));
|
textContainer.setPreferredSize(container.getPreferredSize().addLocal(-250, -200, 0));
|
||||||
|
@ -1,8 +1,18 @@
|
|||||||
package pp.monopoly.game.client;
|
package pp.monopoly.game.client;
|
||||||
|
|
||||||
public class ActiveState extends ClientState{
|
/**
|
||||||
|
* Represents the active client state in the Monopoly game.
|
||||||
|
* Extends {@link ClientState}.
|
||||||
|
*/
|
||||||
|
public class ActiveState extends ClientState {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs an ActiveState with the specified game logic.
|
||||||
|
*
|
||||||
|
* @param logic the client-side game logic associated with this state
|
||||||
|
* used to manage game interactions and transitions
|
||||||
|
*/
|
||||||
ActiveState(ClientGameLogic logic) {
|
ActiveState(ClientGameLogic logic) {
|
||||||
super(logic);
|
super(logic);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,24 +6,25 @@
|
|||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
|
|
||||||
package pp.monopoly.game.client;
|
package pp.monopoly.game.client;
|
||||||
import pp.monopoly.model.IntPoint;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.System.Logger.Level;
|
import java.lang.System.Logger.Level;
|
||||||
|
|
||||||
|
import pp.monopoly.model.IntPoint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the behavior and state transitions for the client-side game logic.
|
* Defines the behavior and state transitions for the client-side game logic in Monopoly.
|
||||||
* Different states of the game logic implement this interface to handle various game events and actions.
|
* Different states of the game logic implement this abstract class to handle various game events and actions.
|
||||||
*/
|
*/
|
||||||
abstract class ClientState {
|
abstract class ClientState {
|
||||||
/**
|
/**
|
||||||
* The game logic object.
|
* The game logic object managing the client-side state.
|
||||||
*/
|
*/
|
||||||
final ClientGameLogic logic;
|
final ClientGameLogic logic;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a client state of the specified game logic.
|
* Constructs a client state for the specified game logic.
|
||||||
*
|
*
|
||||||
* @param logic the game logic
|
* @param logic the game logic
|
||||||
*/
|
*/
|
||||||
@ -49,16 +50,16 @@ abstract class ClientState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the battle state should be shown.
|
* Checks if the player's turn should be shown in the current state.
|
||||||
*
|
*
|
||||||
* @return true if the battle state should be shown, false otherwise
|
* @return true if the player's turn should be shown, false otherwise
|
||||||
*/
|
*/
|
||||||
boolean showTurn() {
|
boolean showTurn() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves the preview figure to the specified position.
|
* Moves the preview figure to the specified position on the game board.
|
||||||
*
|
*
|
||||||
* @param pos the new position for the preview figure
|
* @param pos the new position for the preview figure
|
||||||
*/
|
*/
|
||||||
@ -67,13 +68,13 @@ abstract class ClientState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads a map from the specified file.
|
* Loads a game configuration from the specified file.
|
||||||
*
|
*
|
||||||
* @param file the file to load the map from
|
* @param file the file to load the game configuration from
|
||||||
* @throws IOException if the map cannot be loaded in the current state
|
* @throws IOException if the configuration cannot be loaded in the current state
|
||||||
*/
|
*/
|
||||||
void loadMap(File file) throws IOException {
|
void loadGameConfig(File file) throws IOException {
|
||||||
throw new IOException("You are not allowed to load a map in this state of the game");
|
throw new IOException("You are not allowed to load a game configuration in this state of the game.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -81,5 +82,7 @@ abstract class ClientState {
|
|||||||
*
|
*
|
||||||
* @param delta time in seconds since the last update call
|
* @param delta time in seconds since the last update call
|
||||||
*/
|
*/
|
||||||
void update(float delta) { /* do nothing by default */ }
|
void update(float delta) {
|
||||||
|
// Default implementation does nothing
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,16 @@
|
|||||||
package pp.monopoly.game.client;
|
package pp.monopoly.game.client;
|
||||||
|
|
||||||
public class LobbyState extends ClientState{
|
/**
|
||||||
|
* Represents the lobby state of the client in the Monopoly game.
|
||||||
|
* Extends {@link ClientState}.
|
||||||
|
*/
|
||||||
|
public class LobbyState extends ClientState {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs a LobbyState with the specified game logic.
|
||||||
|
*
|
||||||
|
* @param logic the client-side game logic
|
||||||
|
*/
|
||||||
LobbyState(ClientGameLogic logic) {
|
LobbyState(ClientGameLogic logic) {
|
||||||
super(logic);
|
super(logic);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,16 @@
|
|||||||
package pp.monopoly.game.client;
|
package pp.monopoly.game.client;
|
||||||
|
|
||||||
public class WaitForTurnState extends ClientState{
|
/**
|
||||||
|
* Represents the state where the client is waiting for their turn in the Monopoly game.
|
||||||
|
* Extends {@link ClientState}.
|
||||||
|
*/
|
||||||
|
public class WaitForTurnState extends ClientState {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs a WaitForTurnState with the specified game logic.
|
||||||
|
*
|
||||||
|
* @param logic the client-side game logic
|
||||||
|
*/
|
||||||
WaitForTurnState(ClientGameLogic logic) {
|
WaitForTurnState(ClientGameLogic logic) {
|
||||||
super(logic);
|
super(logic);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user