public Set Forecast(int index) { var stat = SavedTraining.GetTrainingHistory().FindAll(t => t.Sets.Any(s => s.Exercise.Name == this.Exercise.Name)); List <Set> sets = stat.Select(savedTraining => savedTraining.Sets[index]).ToList(); return(Forecast(sets)); }
public float ComparePrevious(CompareTypes compare) { var last = SavedTraining.GetTrainingHistory().FindLast(t => t.Sets.Any(s => s.Exercise.Name == this.Exercise.Name)).Sets[0]; float result = 0; switch (compare) { case CompareTypes.Repeats: result = this.Repeats - (last?.Repeats ?? 0); break; case CompareTypes.WeightDistance: result = this.WeightDistance - (last?.WeightDistance ?? 0); break; case CompareTypes.Progress: result = CompareProgress(last); break; } return(result); }