コード例 #1
0
            public HourPlan Clone()
            {
                var res = new HourPlan();

                res.GroupInform        = new Dictionary <int, Lesson>(GroupInform);
                res.ClassroomInform    = new Dictionary <int, Lesson>(ClassroomInform);
                res.TeacherInform      = new Dictionary <int, Lesson>(TeacherInform);
                res.GroupInformTwo     = new Dictionary <int, Lesson>(GroupInformTwo);
                res.ClassroomInformTwo = new Dictionary <int, Lesson>(ClassroomInformTwo);
                res.TeacherInformTwo   = new Dictionary <int, Lesson>(TeacherInformTwo);
                res.Lessons            = new List <Lesson>(Lessons);
                return(res);
            }
コード例 #2
0
 // Создание плана по списку пар
 public bool Init(List <Lesson> pairs)
 {
     for (int i = 0; i < HoursPerDay; i++)
     {
         for (int j = 0; j < DaysPerWeek; j++)
         {
             HourPlans[j, i] = new HourPlan();
         }
     }
     foreach (var p in pairs)
     {
         if (!AddToAnyDayAndHour(p))
         {
             return(false);
         }
     }
     return(true);
 }