예제 #1
0
 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);
     }
 }
예제 #2
0
 public void AddCoach(Coach coach)
 {
     coach.Club = this;
 }
예제 #3
0
 public void AddCoach(Coach coach)
 {
     coach.Club           = this;
     Coaches[NoOfCoaches] = coach;
     NoOfCoaches++;
 }
예제 #4
0
 public Swimmer(List <TimeSpan> bestTimes, Coach myCoach)
 {
     BestTimes = bestTimes;
     Coach     = myCoach;
 }