Exemple #1
0
        public static TrainingPlanPack Create(TrainingPlan plan, IDictionary <Guid, ExerciseDTO> exercises)
        {
            if (plan == null)
            {
                throw new ArgumentNullException("plan");
            }
            TrainingPlanPack pack = new TrainingPlanPack();

            pack.TrainingPlan = plan;
            foreach (var day in pack.TrainingPlan.Days)
            {
                foreach (var entry in day.Entries)
                {
                    if (entry.Exercise != null && exercises.ContainsKey(entry.Exercise.GlobalId) && pack.Exercises.Where(x => x.GlobalId == entry.Exercise.GlobalId).Count() == 0) //!pack.Exercises.Contains(entry.Exercise.GlobalId))
                    {
                        pack.Exercises.Add(exercises[entry.Exercise.GlobalId]);
                    }
                }
            }
            return(pack);
        }
 public SplitPlanChecker(TrainingPlanPack pack)
 {
     this.pack = pack;
 }