Compare commits

..

No commits in common. "8821602728a7fe246878c5a931a0c40931dd22a9" and "02cfc1d21a29d80867e449400944d8aa559f8c39" have entirely different histories.

5 changed files with 18 additions and 109 deletions

View File

@ -1,60 +0,0 @@
//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);
// }
// };
//}
//

View File

@ -1,17 +1,7 @@
package pp.monopoly.game.client;
/**
* 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) {
super(logic);
}

View File

@ -6,25 +6,24 @@
////////////////////////////////////////
package pp.monopoly.game.client;
import pp.monopoly.model.IntPoint;
import java.io.File;
import java.io.IOException;
import java.lang.System.Logger.Level;
import pp.monopoly.model.IntPoint;
/**
* Defines the behavior and state transitions for the client-side game logic in Monopoly.
* Different states of the game logic implement this abstract class to handle various game events and actions.
* Defines the behavior and state transitions for the client-side game logic.
* Different states of the game logic implement this interface to handle various game events and actions.
*/
abstract class ClientState {
/**
* The game logic object managing the client-side state.
* The game logic object.
*/
final ClientGameLogic logic;
/**
* Constructs a client state for the specified game logic.
* Constructs a client state of the specified game logic.
*
* @param logic the game logic
*/
@ -50,16 +49,16 @@ abstract class ClientState {
}
/**
* Checks if the player's turn should be shown in the current state.
* Checks if the battle state should be shown.
*
* @return true if the player's turn should be shown, false otherwise
* @return true if the battle state should be shown, false otherwise
*/
boolean showTurn() {
return false;
}
/**
* Moves the preview figure to the specified position on the game board.
* Moves the preview figure to the specified position.
*
* @param pos the new position for the preview figure
*/
@ -68,13 +67,13 @@ abstract class ClientState {
}
/**
* Loads a game configuration from the specified file.
* Loads a map from the specified file.
*
* @param file the file to load the game configuration from
* @throws IOException if the configuration cannot be loaded in the current state
* @param file the file to load the map from
* @throws IOException if the map cannot be loaded in the current state
*/
void loadGameConfig(File file) throws IOException {
throw new IOException("You are not allowed to load a game configuration in this state of the game.");
void loadMap(File file) throws IOException {
throw new IOException("You are not allowed to load a map in this state of the game");
}
/**
@ -82,7 +81,5 @@ abstract class ClientState {
*
* @param delta time in seconds since the last update call
*/
void update(float delta) {
// Default implementation does nothing
}
void update(float delta) { /* do nothing by default */ }
}

View File

@ -1,16 +1,7 @@
package pp.monopoly.game.client;
/**
* 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) {
super(logic);
}

View File

@ -1,16 +1,7 @@
package pp.monopoly.game.client;
/**
* 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) {
super(logic);
}