show next up video
This commit is contained in:
@@ -38,6 +38,34 @@ class CurrentWorkoutInfo {
|
||||
return obj
|
||||
}
|
||||
|
||||
var nextExerciseInfo: SupersetExercise? {
|
||||
guard let workout = workout else { return nil }
|
||||
guard let supersets = workout.supersets else { return nil }
|
||||
|
||||
var _exerciseIndex = exerciseIndex + 1
|
||||
var _supersetIndex = supersetIndex
|
||||
let currentSuperSet = supersets[_supersetIndex]
|
||||
|
||||
if _exerciseIndex >= currentSuperSet.exercises.count {
|
||||
var _currentRound = currentRound + 1
|
||||
|
||||
if currentRound > currentSuperSet.rounds {
|
||||
_supersetIndex = _supersetIndex + 1
|
||||
_currentRound = 1
|
||||
|
||||
if supersetIndex >= supersets.count {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
_exerciseIndex = 0
|
||||
}
|
||||
|
||||
let superset = supersets[_supersetIndex]
|
||||
let exercise = superset.exercises[_exerciseIndex]
|
||||
return exercise
|
||||
}
|
||||
|
||||
var nextExercise: SupersetExercise? {
|
||||
guard let workout = workout else { return nil }
|
||||
guard let supersets = workout.supersets else { return nil }
|
||||
|
||||
Reference in New Issue
Block a user