public void Add(Team Team) { AllTeams.Add(Team); var TC = TeamClumps.Find(delegate(CompetingModels CM) { return(CM.CompetingModel == Team.ModelName); }); if (TC == null) { TeamClumps.Add(new CompetingModels() { CompetingModel = Team.ModelName }); } //FO IT SMALLER bool Added = false; if (Team.CM == null) { return; } foreach (var TS in Team.CM.TeamSets) { if (TS.First.Enabled && TS.Second.Enabled && TS.Third.Enabled) { continue; } //bool HasSameP = false; foreach (var T in TS.GetAsList()) { if (!T.Enabled) { continue; } if (!T.HasSameParticipant(Team)) { TS.Add(T); Added = true; //HasSameP = true; } } if (!Added) { Team.CM.TeamSets.Add(new TeamSet() { First = Team }); } } //GenerateTeamSets(); }