View raw

1 " 2 I represent a prescribed workout. 3 " 4 Class { 5 #name : 'MFTWorkoutPrescription', 6 #superclass : 'MFTObject', 7 #instVars : [ 8 'title', 9 'setGroups' 10 ], 11 #category : 'MyFitnessTracker-Core-Prescription', 12 #package : 'MyFitnessTracker-Core', 13 #tag : 'Prescription' 14 } 15 16 { #category : 'heavyDutyOne' } 17 MFTWorkoutPrescription class >> heavyDutyOneDay1 [ 18 19 ^ self new 20 title: 'Day 1'; 21 prescribe: (MFTPreExhaustSupersetGroupPrescription 22 with: (MFTSetPrescription 23 exercise: MFTExercise dumbbellFly 24 alternativeExercises: { 25 MFTExercise cableCross. 26 MFTExercise pecDeck }) 27 with: (MFTSetPrescription exercise: MFTExercise inclinePress)); 28 prescribe: (MFTStraightSetGroupPrescription with: 29 (MFTSetPrescription exercise: MFTExercise lateralRaise)); 30 prescribe: (MFTStraightSetGroupPrescription with: 31 (MFTSetPrescription exercise: MFTExercise rearDeltFly)); 32 prescribe: (MFTSupersetGroupPrescription 33 with: (MFTSetPrescription 34 exercise: MFTExercise lyingFrenchPress 35 alternativeExercises: { MFTExercise tricepPressdown }) 36 with: (MFTSetPrescription exercise: MFTExercise dip)) 37 ] 38 39 { #category : 'as yet unclassified' } 40 MFTWorkoutPrescription class >> heavyDutyOneDay2 [ 41 42 ^ self new 43 title: 'Day 2'; 44 prescribe: (MFTSupersetGroupPrescription 45 with: (MFTSetPrescription exercise: MFTExercise latPullover) 46 with: 47 (MFTSetPrescription exercise: 48 MFTExercise closeGripPalmsUpPulldown)); 49 prescribe: (MFTStraightSetGroupPrescription with: 50 (MFTSetPrescription exercise: MFTExercise bentOverBarbellRows)); 51 prescribe: (MFTStraightSetGroupPrescription with: 52 (MFTSetPrescription exercise: MFTExercise shrug)); 53 prescribe: (MFTStraightSetGroupPrescription with: 54 (MFTSetPrescription exercise: MFTExercise hyperextension)); 55 prescribe: (MFTStraightSetGroupPrescription with: 56 (MFTSetPrescription exercise: MFTExercise bicepCurl)) 57 ] 58 59 { #category : 'as yet unclassified' } 60 MFTWorkoutPrescription class >> heavyDutyOneDay3 [ 61 62 ^ self new 63 title: 'Day 3'; 64 prescribe: (MFTSupersetGroupPrescription 65 with: (MFTSetPrescription exercise: MFTExercise legExtension) 66 with: (MFTSetPrescription 67 exercise: MFTExercise barbellSquat 68 alternativeExercises: { MFTExercise legPress })); 69 prescribe: (MFTStraightSetGroupPrescription with: 70 (MFTSetPrescription exercise: MFTExercise seatedLegCurl)); 71 prescribe: (MFTStraightSetGroupPrescription with: 72 (MFTSetPrescription exercise: MFTExercise calfRaise)); 73 prescribe: (MFTStraightSetGroupPrescription with: 74 (MFTSetPrescription exercise: MFTExercise sitUp)) 75 ] 76 77 { #category : 'as yet unclassified' } 78 MFTWorkoutPrescription class >> heavyDutyTwoDay1 [ 79 80 ^ self new 81 title: 'Day 1'; 82 prescribe: (MFTStraightSetGroupPrescription with: 83 (MFTSetPrescription exercise: MFTExercise barbellSquat)); 84 prescribe: (MFTStraightSetGroupPrescription with: 85 (MFTSetPrescription exercise: 86 MFTExercise closeGripPalmsUpPulldown)) 87 ] 88 89 { #category : 'adding' } 90 MFTWorkoutPrescription >> addSetGroup: aMFTSetGroupPrescription [ 91 92 setGroups addLast: aMFTSetGroupPrescription 93 ] 94 95 { #category : 'initialization' } 96 MFTWorkoutPrescription >> canonicalName [ 97 98 ^ title 99 ] 100 101 { #category : 'initialization' } 102 MFTWorkoutPrescription >> initialize [ 103 104 super initialize. 105 setGroups := OrderedCollection new 106 ] 107 108 { #category : 'as yet unclassified' } 109 MFTWorkoutPrescription >> prescribe: aMFTSetGroupPrescription [ 110 111 self addSetGroup: aMFTSetGroupPrescription 112 ] 113 114 { #category : 'adding' } 115 MFTWorkoutPrescription >> removeSetGroup: aMFTSetGroupPrescription [ 116 117 setGroups remove: aMFTSetGroupPrescription 118 ] 119 120 { #category : 'as yet unclassified' } 121 MFTWorkoutPrescription >> setCount [ 122 123 ^ self sets size 124 ] 125 126 { #category : 'initialization' } 127 MFTWorkoutPrescription >> setGroups [ 128 129 ^ setGroups 130 ] 131 132 { #category : 'as yet unclassified' } 133 MFTWorkoutPrescription >> setGroups: aMFTSetGroupCollection [ 134 135 setGroups := aMFTSetGroupCollection asOrderedCollection 136 ] 137 138 { #category : 'as yet unclassified' } 139 MFTWorkoutPrescription >> sets [ 140 141 ^ setGroups flatCollect: #sets 142 ] 143 144 { #category : 'as yet unclassified' } 145 MFTWorkoutPrescription >> title [ 146 147 ^ title 148 ] 149 150 { #category : 'as yet unclassified' } 151 MFTWorkoutPrescription >> title: aString [ 152 153 title := aString 154 ] 155