public bool TryAddPlayer(Player player) { if (!PlayersMap.TryAdd(player.Id, player)) { return(false); } Players.Add(player); return(true); }
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); }