minor change to addPlayer() method

This commit is contained in:
Sebastian Lenzlinger 2022-04-08 15:45:35 +02:00
parent 9e112b493a
commit f57889431d

View File

@ -74,10 +74,11 @@ public class Lobby {
/**
* Adds a player to the lobby.
* TODO: ad an appropriate response. Currently hardcoded.
* TODO: Does this method need to implemented somewhere else, e.g. in the ClientHandler?
* @param player who wants to join the lobby.
*/
public void addPlayer(ClientHandler player) {
if (players.size() != 6) {
if (players.size() <= MAX_NO_OF_CLIENTS) {
players.add(player);
numberOfPlayersInLobby++;
LOGGER.debug(player.getClientUserName() + " has been added to Lobby with ID: " + lobbyID