public void AddCoach(Coach coach) { if (coach.Club == null) { throw new Exception("Coach is not assigned to the club"); } else if (coach.Club.ClubNumber != coach.Swimmers[numberOfRegistrants++].Club.ClubNumber) { throw new Exception("Coach and swimmer are not in the same club"); } else { this.coach = coach; } }
public void AddCoach(Coach coach) { if (numOfCoaches < maxCoaches) { Coaches[numOfCoaches++] = coach; coach.Club = this; } else { throw new Exception("Cannot add anymore coaches!"); } }