Exemple #1
0
 public Lesson(Lesson les)
 {
     _free     = false;
     _type     = les.LessonType;
     _subject  = les.Subject;
     _teacher  = les.Teacher;
     _group    = les.Group;
     _audience = les.Audience;
 }
Exemple #2
0
        public void FillForDay(string group, string subject, Utilities.LessonType type, JsonElement root)
        {
            var workingHours      = Utilities.GetAsObjectJSON <string[]>(root, "Lessons_time");
            var successfullyAdded = false;

            while (!successfullyAdded)
            {
                var choosedHour = Utilities.ChooseRandomly(0, workingHours.Length);
                if (_day[workingHours[choosedHour]].IsFree)
                {
                    _day[workingHours[choosedHour]].FillForHour(group, subject, type, root);
                    successfullyAdded = true;
                }
            }
        }
Exemple #3
0
        public void FillForHour(String group, String subject, Utilities.LessonType type, JsonElement root)
        {
            _type = type;
            Dictionary <String, String> _subjectLecturer = Utilities.GetAsObjectJSON(root, "Subject_lecturer", "Subject");

            string[] teachers  = Utilities.GetAsObjectJSON <string[]>(root, "Teacher");
            int[]    audiences = Utilities.GetAsObjectJSON <int[]>(root, "Audience");
            if (type == Utilities.LessonType.Lecture)
            {
                _teacher = _subjectLecturer[subject];
            }
            else
            {
                int choosedTeacher = Utilities.ChooseRandomly(0, teachers.Length);
                _teacher = teachers[choosedTeacher];
            }
            _subject  = subject;
            _group    = group;
            _audience = audiences[Utilities.ChooseRandomly(0, audiences.Length)];
            _free     = false;
        }