예제 #1
0
        public bool TryAddPlayer(Player player)
        {
            if (!PlayersMap.TryAdd(player.Id, player))
            {
                return(false);
            }

            Players.Add(player);

            return(true);
        }
예제 #2
0
        public bool TryAddPlayer(Player player)
        {
            //if (ContainsPlayer(player.Id))
            //{
            //    return false;
            //}

            if (!PlayersMap.TryAdd(player.Id, player))
            {
                return(false);
            }

            Players.Add(player);

            //_playerIds.Add(player.Id);

            //PlayersMap.TryAdd(player.Id, player);

            return(true);
        }