public override void removeAthlete(Athlete Athlete) { if (Athlete == null) { return; } ACompetitor c = EnteredCompetitors.Where(e => e.isAthlete(Athlete)).FirstOrDefault(); if (c != null) { this.removeCompetitor(c); } }
public override void removeAthlete(Athlete Athlete) { if (Athlete == null) { return; } Squad s = (Squad)EnteredCompetitors.Where(e => e.isAthlete(Athlete)).FirstOrDefault(); if (s != null) { if (s.Competitor1 != null) { if (s.Competitor1 == Athlete) { s.Competitor1 = null; } } if (s.Competitor2 != null) { if (s.Competitor2 == Athlete) { s.Competitor2 = null; } } if (s.Competitor3 != null) { if (s.Competitor3 == Athlete) { s.Competitor3 = null; } } if (s.Competitor4 != null) { if (s.Competitor4 == Athlete) { s.Competitor4 = null; } } } if (s.isSquadEmpty()) { this.removeCompetitor(s); } }