public void AddCoach(Coach coach) { if (coach.Club != this && coach.Club != null) { throw (new Exception($"Swimmer {coach.Name} already assigned to {coach.Club.Name} club")); } else if (coach.Club == null) { coachs.Add(coach); coach.Club = this; } else if (coach.Club == this && !coachs.Contains(coach)) { coachs.Add(coach); } }
public void AddCoach(Coach coach) { coach.Club = this; }
public void AddCoach(Coach coach) { coach.Club = this; Coaches[NoOfCoaches] = coach; NoOfCoaches++; }
public Swimmer(List <TimeSpan> bestTimes, Coach myCoach) { BestTimes = bestTimes; Coach = myCoach; }