예제 #1
0
        private bool CalculateSetup_EmptyKindOfClassActivities
        (
            ImmutableListEnumerator <Course> courses,
            CourseGroup group,
            ImmutableListEnumerator <ClassActivitiesInfo> classActivitiesOfKindEnumerator,
            ClassActivitiesInfo classActivitiesOfKind)
        {
            if (!classActivitiesOfKind.CanBeEmpty)
            {
                throw new InvalidScheduleException("The class activities cannot be empty");
            }

            return(CalculateSetup_NextClassActivity(courses, group, classActivitiesOfKindEnumerator, null));
        }
예제 #2
0
        private bool CalculateSetup_ClassActivitiesOfKind
        (
            ImmutableListEnumerator <Course> courses,
            CourseGroup group,
            ImmutableListEnumerator <ClassActivitiesInfo> classActivitiesOfKindEnumerator,
            ClassActivitiesInfo classActivitiesOfKind
        )
        {
            bool atLeastOne = false;

            foreach (IClassActivity classActivity in classActivitiesOfKind)
            {
                bool successs = CalculateSetup_NextClassActivity(courses, group, classActivitiesOfKindEnumerator, classActivity);
                if (successs)
                {
                    atLeastOne = true;
                }
            }

            return(atLeastOne);
        }
예제 #3
0
        private bool CalculateSetup_NextKindOfClassActivities
        (
            ImmutableListEnumerator <Course> courses,
            CourseGroup group,
            ImmutableListEnumerator <ClassActivitiesInfo> classActivitiesOfKindEnumerator
        )
        {
            classActivitiesOfKindEnumerator = classActivitiesOfKindEnumerator.MoveNext();
            if (classActivitiesOfKindEnumerator.HasEnded)
            {
                return(CalculateSetup_BuildCoursePlacement(courses, group));
            }

            ClassActivitiesInfo classActivitiesOfKind = classActivitiesOfKindEnumerator.Current;

            if (classActivitiesOfKind.IsEmpty())
            {
                return(CalculateSetup_EmptyKindOfClassActivities(courses, group, classActivitiesOfKindEnumerator, classActivitiesOfKind));
            }

            return(CalculateSetup_ClassActivitiesOfKind(courses, group, classActivitiesOfKindEnumerator, classActivitiesOfKind));
        }
예제 #4
0
 private void BuildPraticeClassesForCourse(Course course)
 {
     PraticeClasses[course] = new ClassActivitiesInfo(GetAllPracticeClassesOfCourse(course), true);
 }