lobby uebergibt farbe und startgeld

This commit is contained in:
Yvonne Schmidt
2024-11-24 18:07:39 +01:00
parent 437114704a
commit 9a6ce27fe1
3 changed files with 98 additions and 13 deletions

View File

@@ -51,7 +51,7 @@ public class ClientGameLogic implements ServerInterpreter, GameEventBroker {
/** The current state of the client game logic. */
private ClientState state = new LobbyState(this);
private PlayerHandler playerHandler;
private static PlayerHandler playerHandler;
/**
* Constructs a ClientGameLogic with the specified sender object.
@@ -83,7 +83,7 @@ public class ClientGameLogic implements ServerInterpreter, GameEventBroker {
state.entry();
}
public PlayerHandler getPlayerHandler() {
public static PlayerHandler getPlayerHandler() {
return playerHandler;
}

View File

@@ -157,7 +157,7 @@ public class PlayerHandler {
* @param id the id to be searched for
* @return the player with the required id
*/
Player getPlayerById(int id) {
public Player getPlayerById(int id) {
for (Player player : players) {
if (player.getId() == id) return player;
}
@@ -176,7 +176,7 @@ public class PlayerHandler {
players.get(0).setActive();
}
void setStartBalance(int amount) {
public void setStartBalance(int amount) {
for (Player player : players) {
player.setAccountBalance(amount);
}