Exemplo n.º 1
0
        public bool TryAddPlayer(Player player)
        {
            if (!PlayersMap.TryAdd(player.Id, player))
            {
                return(false);
            }

            Players.Add(player);

            return(true);
        }
Exemplo n.º 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);
        }