public static Exercise ExerciseFromString(string exerciseAsString, ExerciseConfiguration configurationUsedForReset) { try { var keyValuePairFromString = GetNameValuePairsFromString(exerciseAsString); return(new Exercise(configurationUsedForReset) { LongLeftCount = keyValuePairFromString[nameof(LongLeftCount)], LongRightCount = keyValuePairFromString[nameof(LongRightCount)], ShortLeftCount = keyValuePairFromString[nameof(ShortLeftCount)], ShortRightCount = keyValuePairFromString[nameof(ShortRightCount)], RemainingPreparationTime = keyValuePairFromString[nameof(RemainingPreparationTime)], RemainingSubExerciseTime = keyValuePairFromString[nameof(RemainingSubExerciseTime)], CurrentSubExercise = (SubExercise)keyValuePairFromString[nameof(CurrentSubExercise)] }); } catch (Exception) { return(ExerciseFromConfiguration(configurationUsedForReset)); } }
public static Exercise ExerciseFromConfiguration(ExerciseConfiguration configuration) { return(new Exercise(configuration)); }
public Exercise(ExerciseConfiguration configuration) { mConfiguration = configuration; CalculateTotalTime(); Reset(); }