示例#1
0
 public Coach AddCoach(Coach coach)
 {
     if (coach.TEAM_ID == 1010 || coach.TEAM_ID == 1011) // skip probowl coaches
     {
         return(null);
     }
     foreach (Coach c in Coaches)
     {
         if (coach.COACH_ID == c.COACH_ID)              // NO duplicates
         {
             return(null);
         }
     }
     coach.InitHistory(model);
     if (coach.TEAM_ID == 1023)                         // Fix streameddb coaches teamid
     {
         coach.TEAM_ID = 1009;
     }
     Coaches.Add(coach);
     if (coach.CONTRACT_LENGTH > 0)
     {
         return(coach);
     }
     else if (coach.History.ContainsKey(model.CurrentYear))
     {
         if (coach.History[model.CurrentYear].TeamID != 1009)
         {
             return(coach);
         }
     }
     return(null);
 }