示例#1
0
        public MonthSummaryBuilder(int targetYear, int targetMonth, DateTimeZone zone,
                                   StepBuilder stepBuilder,
                                   GeneralRecordsBuilder generalRecordsBuilder,
                                   HealthMarkersBuilder healthMarkersBuilder,
                                   NutritionBuilder nutritionBuilder,
                                   WorkoutBuilderFactory workoutBuilderFactory,
                                   DistanceCyclingBuilder distanceCyclingBuilder,
                                   MassBuilder massBuilder,
                                   BodyFatPercentageBuilder bodyFatBuilder)
        {
            _monthDays = Enumerable.Range(1, DateTime.DaysInMonth(targetYear, targetMonth))
                         .Select(d => new LocalDate(targetYear, targetMonth, d))
                         .ToList();

            var range = new DateRange(_monthDays.First().AtStartOfDayInZone(zone), _monthDays.Last().AtStartOfDayInZone(zone));

            _columns = Enumerable.Empty <Column <LocalDate> >()
                       .Concat(stepBuilder.BuildSummaryForDateRange(range))
                       .Concat(bodyFatBuilder.BuildSummaryForDateRange(range))
                       .Concat(generalRecordsBuilder.BuildSummaryForDateRange(range))
                       .Concat(healthMarkersBuilder.BuildSummaryForDateRange(range))
                       .Concat(nutritionBuilder.BuildSummaryForDateRange(range))
                       .Concat(massBuilder.BuildSummaryForDateRange(range))
                       .Concat(distanceCyclingBuilder.BuildSummaryForDateRange(range))
                       .Concat(workoutBuilderFactory.GetWorkoutBuilders().SelectMany(b => b.BuildSummaryForDateRange(range)))
            ;
        }
        public MonthSummaryBuilder(int targetYear, int targetMonth, DateTimeZone zone,
                                   StepBuilder stepBuilder,
                                   GeneralRecordsBuilder generalRecordsBuilder,
                                   HealthMarkersBuilder healthMarkersBuilder,
                                   NutritionBuilder nutritionBuilder,
                                   CyclingWorkoutBuilder cyclingBuilder,
                                   PlayWorkoutBuilder playBuilder,
                                   EllipticalWorkoutBuilder ellipticalBuilder,
                                   RunningWorkoutBuilder runningBuilder,
                                   WalkingWorkoutBuilder walkingBuilder,
                                   StrengthTrainingBuilder strengthBuilder,
                                   HiitBuilder hiitBuilder,
                                   DistanceCyclingBuilder distanceCyclingBuilder,
                                   MassBuilder massBuilder,
                                   BodyFatPercentageBuilder bodyFatBuilder)
        {
            _monthDays = Enumerable.Range(1, DateTime.DaysInMonth(targetYear, targetMonth))
                         .Select(d => new LocalDate(targetYear, targetMonth, d))
                         .ToList();

            var range = new DateRange(_monthDays.First().AtStartOfDayInZone(zone), _monthDays.Last().AtStartOfDayInZone(zone));

            _columns = Enumerable.Empty <Column <LocalDate> >()
                       .Concat(stepBuilder.BuildSummaryForDateRange(range))
                       .Concat(bodyFatBuilder.BuildSummaryForDateRange(range))
                       .Concat(generalRecordsBuilder.BuildSummaryForDateRange(range))
                       .Concat(healthMarkersBuilder.BuildSummaryForDateRange(range))
                       .Concat(nutritionBuilder.BuildSummaryForDateRange(range))
                       .Concat(massBuilder.BuildSummaryForDateRange(range))
                       .Concat(distanceCyclingBuilder.BuildSummaryForDateRange(range))
                       .Concat(cyclingBuilder.BuildSummaryForDateRange(range))
                       .Concat(playBuilder.BuildSummaryForDateRange(range))
                       .Concat(ellipticalBuilder.BuildSummaryForDateRange(range))
                       .Concat(walkingBuilder.BuildSummaryForDateRange(range))
                       .Concat(runningBuilder.BuildSummaryForDateRange(range))
                       .Concat(strengthBuilder.BuildSummaryForDateRange(range))
                       .Concat(hiitBuilder.BuildSummaryForDateRange(range))
            ;
        }