mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-18 18:23:44 +01:00
Java Docs
This commit is contained in:
parent
a73384c436
commit
30822e3f4d
@ -1,8 +1,18 @@
|
||||
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) {
|
||||
super(logic);
|
||||
}
|
||||
}
|
||||
}
|
@ -6,24 +6,25 @@
|
||||
////////////////////////////////////////
|
||||
|
||||
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.
|
||||
* Different states of the game logic implement this interface to handle various game events and actions.
|
||||
* 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.
|
||||
*/
|
||||
abstract class ClientState {
|
||||
/**
|
||||
* The game logic object.
|
||||
* The game logic object managing the client-side state.
|
||||
*/
|
||||
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
|
||||
*/
|
||||
@ -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() {
|
||||
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
|
||||
*/
|
||||
@ -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
|
||||
* @throws IOException if the map cannot be loaded in the current state
|
||||
* @param file the file to load the game configuration from
|
||||
* @throws IOException if the configuration cannot be loaded in the current state
|
||||
*/
|
||||
void loadMap(File file) throws IOException {
|
||||
throw new IOException("You are not allowed to load a map in this state of the game");
|
||||
void loadGameConfig(File file) throws IOException {
|
||||
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
|
||||
*/
|
||||
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;
|
||||
|
||||
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) {
|
||||
super(logic);
|
||||
}
|
||||
|
@ -1,7 +1,16 @@
|
||||
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) {
|
||||
super(logic);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user