private static List <IntervalWorkoutConfig> BuildThibaultInterval(List <ThibaultModelItem> list)
        {
            List <ThibaultModelGuideline> thibaultGuidelines     = IntervalCalculations.GetThibaultGuidelines();
            List <IntervalWorkoutConfig>  intervalWorkoutConfigs = new List <IntervalWorkoutConfig>();

            foreach (ThibaultModelItem thibaultModelItem in list)
            {
                if ((thibaultModelItem.TotalReps <= 24 ? false : thibaultModelItem.TotalReps <= 30))
                {
                    ThibaultModelGuideline thibaultModelGuideline = thibaultGuidelines.First <ThibaultModelGuideline>((ThibaultModelGuideline x) => x.NumSets == 4);
                    intervalWorkoutConfigs.Add(IntervalCalculations.ConfigureThibaultWorkout(thibaultModelGuideline, thibaultModelItem, thibaultModelItem.MaxAerobicPower));
                }
                else if ((thibaultModelItem.TotalReps <= 14 ? false : thibaultModelItem.TotalReps <= 24))
                {
                    ThibaultModelGuideline thibaultModelGuideline1 = thibaultGuidelines.First <ThibaultModelGuideline>((ThibaultModelGuideline x) => x.NumSets == 3);
                    intervalWorkoutConfigs.Add(IntervalCalculations.ConfigureThibaultWorkout(thibaultModelGuideline1, thibaultModelItem, thibaultModelItem.MaxAerobicPower));
                }
                else if ((thibaultModelItem.TotalReps <= 7 ? false : thibaultModelItem.TotalReps <= 14))
                {
                    ThibaultModelGuideline thibaultModelGuideline2 = thibaultGuidelines.First <ThibaultModelGuideline>((ThibaultModelGuideline x) => x.NumSets == 2);
                    intervalWorkoutConfigs.Add(IntervalCalculations.ConfigureThibaultWorkout(thibaultModelGuideline2, thibaultModelItem, thibaultModelItem.MaxAerobicPower));
                }
                else if ((thibaultModelItem.TotalReps < 3 ? false : thibaultModelItem.TotalReps <= 7))
                {
                    ThibaultModelGuideline thibaultModelGuideline3 = thibaultGuidelines.First <ThibaultModelGuideline>((ThibaultModelGuideline x) => x.NumSets == 1);
                    intervalWorkoutConfigs.Add(IntervalCalculations.ConfigureThibaultWorkout(thibaultModelGuideline3, thibaultModelItem, thibaultModelItem.MaxAerobicPower));
                }
            }
            return(intervalWorkoutConfigs);
        }
        private static List <ThibaultModelGuideline> GetThibaultGuidelines()
        {
            List <ThibaultModelGuideline> thibaultModelGuidelines = new List <ThibaultModelGuideline>();
            ThibaultModelGuideline        thibaultModelGuideline  = new ThibaultModelGuideline(4, 60, 180);
            ThibaultModelGuideline        thibaultModelGuideline1 = new ThibaultModelGuideline(3, 120, 300);
            ThibaultModelGuideline        thibaultModelGuideline2 = new ThibaultModelGuideline(2, 180, 600);
            ThibaultModelGuideline        thibaultModelGuideline3 = new ThibaultModelGuideline(1, 300, 0);

            thibaultModelGuidelines.Add(thibaultModelGuideline);
            thibaultModelGuidelines.Add(thibaultModelGuideline1);
            thibaultModelGuidelines.Add(thibaultModelGuideline2);
            thibaultModelGuidelines.Add(thibaultModelGuideline3);
            return(thibaultModelGuidelines);
        }
        private static IntervalWorkoutConfig ConfigureThibaultWorkout(ThibaultModelGuideline g, ThibaultModelItem i, int maxAerobicPower)
        {
            IntervalWorkoutConfig intervalWorkoutConfig = new IntervalWorkoutConfig();

            intervalWorkoutConfig.IntervalIntensity  = string.Concat(maxAerobicPower.ToString(), "% MAP");
            intervalWorkoutConfig.NumberOfRepsPerSet = System.Convert.ToInt32(Math.Round((double)i.TotalReps / (double)g.NumSets));
            intervalWorkoutConfig.NumberOfSets       = g.NumSets;
            intervalWorkoutConfig.TotalNumberOfReps  = intervalWorkoutConfig.NumberOfRepsPerSet * intervalWorkoutConfig.NumberOfSets;
            //intervalWorkoutConfig.RecoveryIntensity = "<60% MAP"; //this is based on user input now.  Get value from the Settings class
            intervalWorkoutConfig.RepDuration   = i.Duration;
            intervalWorkoutConfig.RepRecovery   = g.RepRecovery;
            intervalWorkoutConfig.SetRecovery   = g.SetRecovery;
            intervalWorkoutConfig.TotalDuration = intervalWorkoutConfig.TotalNumberOfReps * (intervalWorkoutConfig.RepDuration + intervalWorkoutConfig.RepRecovery) + intervalWorkoutConfig.NumberOfSets * intervalWorkoutConfig.SetRecovery;
            intervalWorkoutConfig.PercentMAP    = (maxAerobicPower / 100.0);

            return(intervalWorkoutConfig);
        }