" I represent an exercise set prescribed for a workout. " Class { #name : 'MFTSetPrescription', #superclass : 'MFTObject', #instVars : [ 'exercise', 'alternativeExercises', 'repScheme' ], #category : 'MyFitnessTracker-Core-Prescription', #package : 'MyFitnessTracker-Core', #tag : 'Prescription' } { #category : 'as yet unclassified' } MFTSetPrescription class >> exercise: aMFTExercise [ ^ self new exercise: aMFTExercise; yourself ] { #category : 'as yet unclassified' } MFTSetPrescription class >> exercise: aMFTExercise alternativeExercises: aMFTExerciseCollection [ ^ self new exercise: aMFTExercise; alternativeExercises: aMFTExerciseCollection; yourself ] { #category : 'as yet unclassified' } MFTSetPrescription class >> exercise: aMFTExercise repScheme: aMFTRepScheme [ ^ self new exercise: aMFTExercise; repScheme: aMFTRepScheme; yourself ] { #category : 'comparing' } MFTSetPrescription >> = anObject [ self == anObject ifTrue: [ ^ true ]. self class = anObject class ifFalse: [ ^ false ]. ^ repScheme = anObject repScheme and: [ exercise = anObject exercise ] ] { #category : 'accessing' } MFTSetPrescription >> alternativeExercises [ ^ alternativeExercises ] { #category : 'accessing' } MFTSetPrescription >> alternativeExercises: aMFTExerciseCollection [ alternativeExercises := aMFTExerciseCollection ] { #category : 'initialization' } MFTSetPrescription >> canonicalName [ ^ repScheme canonicalName , ' reps ' , exercise canonicalName ] { #category : 'accessing' } MFTSetPrescription >> exercise [ ^ exercise ] { #category : 'as yet unclassified' } MFTSetPrescription >> exercise: aMFTExercise [ exercise := aMFTExercise ] { #category : 'comparing' } MFTSetPrescription >> hash [ "Answer an integer value that is related to the identity of the receiver." ^ repScheme hash bitXor: exercise hash ] { #category : 'as yet unclassified' } MFTSetPrescription >> initialize [ super initialize. repScheme := MFTRepScheme from: 6 to: 10. alternativeExercises := OrderedCollection new ] { #category : 'as yet unclassified' } MFTSetPrescription >> repScheme [ ^ repScheme ] { #category : 'as yet unclassified' } MFTSetPrescription >> repScheme: aMFTRepScheme [ repScheme := aMFTRepScheme ]