public void RemovePlayer(string name) { foreach (var pl in Team1.ToArray()) { if (pl.Name == name) { Team1.Remove(pl); } } foreach (var pl in Team2.ToArray()) { if (pl.Name == name) { Team2.Remove(pl); } } }