Spieler Lobby

This commit is contained in:
Luca Puderbach
2024-11-19 23:09:39 +01:00
parent 6e63de6e99
commit 7da8b3e545
5 changed files with 150 additions and 176 deletions

View File

@@ -1,50 +1,38 @@
package pp.monopoly.message.client;
import pp.monopoly.game.server.PlayerColor;
/**
* Represents a message indicating the player is ready to play.
*/
public class PlayerReady extends ClientMessage{
public class PlayerReady extends ClientMessage {
private boolean isReady;
private String name;
private PlayerColor color;
private String figure;
/**
* Constructs a PlayerReady message.
*
* @param isReady true if the player is ready, false otherwise
* @param name the name of the player
* @param color the color of the player (can be null)
*/
public PlayerReady(boolean isReady) {
public PlayerReady(boolean isReady, String name, String figure) {
this.isReady = isReady;
this.name = name;
this.figure = figure;
}
/**
* Getter for the Name
* @return the Name
*/
public String getName() {
return name;
}
/**
* Getter for the Playercolor
* @return the Playercolor
*/
public PlayerColor getColor() {
return color;
public String getFigure() {
return figure;
}
/**
* Checks if the player is ready.
*
* @return true if ready, false otherwise
*/
public boolean isReady() {
return isReady;
}
@Override
public void accept(ClientInterpreter interpreter, int from) {
interpreter.received(this, from);