/// <summary>
        /// Adds client to game
        /// </summary>
        /// <param name="client"></param>
        /// <returns>Returns true if client added. False if client is not added
        /// </returns>

        private void numberOfClientsInGameLobbyChanged()
        {
            if (status.CompareTo(GameLobbyStatus.Game_Ended) == 0)
            {
                if (clientsConnectedToGame.Count <= 0)
                {
                    //no players left
                    //Game should be cleaned up.
                }
            }
            if (clientsConnectedToGame.Count > MonopolyDeal.getMaxPlayers())
            {
                setStatus(GameLobbyStatus.overFull);
                //To many players to start game
            }
            else if (clientsConnectedToGame.Count == MonopolyDeal.getMaxPlayers())
            {
                setStatus(GameLobbyStatus.Full);
            }
            else if (clientsConnectedToGame.Count == 0)
            {
                setStatus(GameLobbyStatus.Empty);
            }
            else if (clientsConnectedToGame.Count == 1)
            {
                setStatus(GameLobbyStatus.Not_Enough_Players_To_Start);
            }
            else if (clientsConnectedToGame.Count >= MonopolyDeal.getMinPlayers())
            {
                setStatus(GameLobbyStatus.Enough_Players_To_Start);
            }
        }
Exemple #2
0
 public int getMinPlayersPerGame()
 {
     return(MonopolyDeal.getMinPlayers());
 }