예제 #1
0
        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));
            }
        }
예제 #2
0
 public static Exercise ExerciseFromConfiguration(ExerciseConfiguration configuration)
 {
     return(new Exercise(configuration));
 }
예제 #3
0
 public Exercise(ExerciseConfiguration configuration)
 {
     mConfiguration = configuration;
     CalculateTotalTime();
     Reset();
 }