Last active
August 29, 2015 14:03
-
-
Save morganwilde/49d400dddda470f600da to your computer and use it in GitHub Desktop.
finder.m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (Activity *)initiateActivityForPerson | |
{ | |
Activity *activity = [[Activity alloc] init]; | |
/* Set all the prerequisites */ | |
activity.user = [self.sdk currentUser]; | |
activity.name = [NSString stringWithFormat:@"Play %@", self.level.name]; | |
activity.activityType = 1; | |
activity.multiplayer = YES; | |
activity.level = self.level.level + 1; | |
// Questions for this activity | |
NSArray * cards = [self cardsForToday:YES andLevel:self.level]; | |
Deck * deck = [[Deck alloc] initWithCards:cards]; | |
activity.questions = [deck questions]; | |
return activity; | |
} | |
- (void)actPlayFriend:(NSString *)friendCode | |
{ | |
/* Use this if you have a friend code */ | |
GameVC *parentVC = (GameVC *)self.parentViewController; | |
parentVC.activity = [self initiateActivityForPerson]; | |
parentVC.activity.friendCode = friendCode; | |
[self.sdk startActivity:parentVC.activity]; | |
[parentVC actFindOpponent]; | |
} | |
- (void)actPlayOpponent:(int)opponentId | |
{ | |
/* Use this if you have an opponent ID */ | |
GameVC *parentVC = (GameVC *)self.parentViewController; | |
parentVC.activity = [self initiateActivityForPerson]; | |
parentVC.activity.opponentID = opponentId; | |
[self.sdk startActivity:parentVC.activity]; | |
[parentVC actFindOpponent]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment