#import "RPSTurn.h" @implementation RPSTurn -(instancetype)initWithMove:(Move) move{ self = [super init]; if (self){ _move = move; } return self; }
#import "RPSGame.h" @implementation RPSGame -(instancetype)initWithFirstTurn:(RPSTurn*) playerTurn secondTurn: (RPSTurn*)computerTurn { self = [super init]; if(self){ _firstTurn = playerTurn; _secondTurn = computerTurn; } return self; }
The Method throwDown
#import "RPSController.h" #import "RPSTurn.h" @implementation RPSController -(void)throwDown:(Move) playersMove { // Here the RPSTurn class generates the opponent's move RPSTurn *playerTurn = [[RPSTurn alloc]initWithMove:playersMove]; }