#import <OFChallengeToUser.h>
List of all members.
Detailed Description
A OFChallengeToUser is received when another user has challenged this user. The public interface for OFChallengeToUser allows you to see the details of that challenge, as well as commit a result for that challenge (win/lose/tie) and also send a rechallenge.
Member Function Documentation
Send when the challenge is complete.
- Parameters:
-
challengeResult | OFChallengeResult enum with either win, lose or tie |
- Note:
- This should be called before you call displayChallengeCompletedModal
-
You can not call this with a result of value kChallengeIncomplete.
-
If you would like a description, please set the resultDescription property on the OFChallenengeToUser before calling this.
- Returns:
- OFRequestHandle for the server request. Use this to cancel the request
- Note:
- Invokes - (void)didCompleteChallenge:(OFChallengeToUser*)challengeToUser on success and
- (void)didFailCompleteChallenge:(OFChallengeToUser*)challengeToUser on failure
- (void) displayCompletionWithData: |
|
(NSData *) |
resultData |
reChallengeDescription: |
|
(NSString *) |
reChallengeDescription |
|
|
| |
Displays the default OpenFeint View for completing Challenges. If the user submits this view the challenger will be sent a message about the challenge result.
- Parameters:
-
resultData | Only used for multiAttempt challenges. The data needed to send the challenge result out as a new challenge |
reChallengeDescription | If the challenge result is sent out as a new challenge (multi attempt only), this will be the description for the new challenge. Should be formatted the same way as challengeText in sendChallenge |
- Note:
- Call completeWithResult before calling this. It stores nessiary data for this view If the user turns off the game during the challenge you must serialize the OFChallengeToUser as its used to display the completion modal. Serialize it to and from disc by calling writeChallengeToUserToFile or readChallengeToUserFromFile.
+ (NSString*) getResourceName |
|
|
|
Read the ChallengeToUser data from a file
- Parameters:
-
fileName | The name of the file to read the data from |
- Returns:
- OFChallengeToUser The OFChallengeToUser deserialized from the file
Reject a challenge
- Note:
- A rejected challenge will no longer appear in the pending challenges list
- Returns:
- OFRequestHandle for the server request. Use this to cancel the request
- Note:
- Invokes - (void)didRejectChallenge:(OFChallengeToUser*)challengeToUser; on success and
- (void)didFailRejectChallenge:(OFChallengeToUser*)challengeToUser; on failure
- (void) writeToFile: |
|
(NSString *) |
fileName |
|
Property Documentation
- (NSUInteger) attempts [read, assign] |
Number of challenge attempts by this user.
The challenge which was sent.
- (NSString*) formattedResultDescription [read, assign] |
The descprtion of the result defined by resultDescription with You or the user name appended to the front.
- (BOOL) hasBeenViewed [read, assign] |
Wether or not the challenge has be viewed by the challengee
- (BOOL) hasDecrementedChallengeCount [read, write, assign] |
- (BOOL) isCompleted [read, write, assign] |
- (OFUser *) recipient [read, assign] |
the user taht started this challenge
The result of the challenge
- (NSString *) resultDescription [read, write, retain] |
Description of the result. This is set well calling sendChallengeComplete
The result description will be prefixed by either the recipients name or You if it's the local player whenever displayed. The result description should not state if the recipient won or lost but contain the statistics of his attempt. Example: "beat 30 monsters" will turn into "You beat 30 monsters" and will be display next to a icon for win or lose
The documentation for this class was generated from the following file: