コード例 #1
0
        /// <summary>
        /// TODO: 2 saatlik dersler parçalandı :(
        /// Tekli sayılardan alırsam aslında 2-2 'lik dersleri bölmem ama suan gerek yok
        /// </summary>
        /// <returns></returns>
        private Lesson DequeueWithCalculatedHour()
        {
            var lesson = Lessons.Dequeue();
            var hour   = lesson.Hour switch
            {
                0 => 2,
                1 => 1,
                _ => 2
            };

            lesson.SetHour(hour);
            var remainedHours = Math.Abs(this.CurrentDailyHours - this.TotalDailyHours);

            if (remainedHours < lesson.Hour && remainedHours != 0)
            {
                lesson.SetHour(remainedHours);
            }

            this.CurrentDailyHours += lesson.Hour;
            return(lesson);
        }