Public Member Functions | Static Public Member Functions | Properties

OFHighScore Class Reference

#import <OFHighScore.h>

List of all members.

Public Member Functions

(OFHighScore *) - initForSubmissionWithScore:
(void) - submitTo:
(OFRequestHandle *) - downloadBlob
(id) - initWithLocalSQL:forUser:rank:
(BOOL) - hasBlob
(void) - _setBlob:

Static Public Member Functions

(void) + setDelegate:
(NSArray *) + allHighScoresForCurrentUser
(OFRequestHandle *) + getHighScoresNearCurrentUserForLeaderboard:andBetterCount:andWorseCount:
(NSString *) + getResourceName

Properties

int64_t score
NSString * displayText
NSString * customData
NSData * blob
NSInteger rank
OFUseruser
NSString * leaderboardId
NSString * toHighRankText
NSString * blobUrl
OFS3UploadParameters * blobUploadParameters
double latitude
double longitude
double distance
NSUInteger gameCenterSeconds
NSString * gameCenterId
NSString * gameCenterName

Member Function Documentation

- (void) _setBlob: (NSData *)  _blob
+ (NSArray*) allHighScoresForCurrentUser

Retrieves the current user's high scores for all application leaderboards.

Note:
The rank property on the OFHighScore objects returned from this method will not be set.
Returns:
NSArray of OFHighScore objects; one for each leaderboard.
- (OFRequestHandle*) downloadBlob

The blob needs to be explicity downloaded. After calling this the blob property will be filled out if we have data attached to this high score.

Returns:
OFRequestHandle for the server request. Use this to cancel the request
Note:
Invokes - (void)didDownloadBlob:(OFHighScore*)score; on success and
  • (void)didFailDownloadBlob:(OFHighScore*)score; on failure
+ (OFRequestHandle*) getHighScoresNearCurrentUserForLeaderboard: (OFLeaderboard *)  leaderboard
andBetterCount: (uint)  betterCount
andWorseCount: (uint)  worseCount 

Get an NSArray* of scores near the users high score. The array will contain the users highscore in the middle of the worse and better scores.

Parameters:
leaderboardThe leaderboard which you want to search for high scores.
betterCountThe amount of scores you want that are better than the current user's score. Max is 50.
worseCountThe amount of scores you want that are worse than the current user's score. Max is 50.
Returns:
OFRequestHandle for the server request. Use this to cancel the request
Note:
Invokes - (void)didGetHighScoresNearCurrentUser:(NSArray*)scores; on success and
  • (void)didFailGetHighScoresNearCurrentUser:(NSArray*)scores; on failure
+ (NSString*) getResourceName
- (BOOL) hasBlob
- (OFHighScore*) initForSubmissionWithScore: (int64_t)  submitScore

Initializes a HighScore for sumbittion. Use OFLeaderboard's submitScore: to submit this score to a leaderboard.

Parameters:
submitScorescore to submit
Note:
You may optionally also fillout the dispalyText customData blob properties before submission and after initialization.
Returns:
an initialized OFHighScore
- (id) initWithLocalSQL: (OFSqlQuery *)  queryRow
forUser: (OFUser *)  hsUser
rank: (NSUInteger)  scoreRank 
+ (void) setDelegate: (id< OFHighScoreDelegate >)  delegate

Set a delegate for all OFHighScore related actions. Must adopt the OFHighScoreDelegate protocol.

Note:
Defaults to nil. Weak reference
- (void) submitTo: (OFLeaderboard *)  leaderboard

Submit score to a leaderboard

Parameters:
leaderbardThe leaderboard to submit to.
Note:
To create a high score to submit see OFHighScore's initForSubmissionWithScore: method.
See also:
OFHighScore

Property Documentation

- (NSData *) blob [read, write, retain]

The data uploaded with this high score.

Note:
You must explicitly call downloadBlob on a highscore to have this data filled out.
- (OFS3UploadParameters *) blobUploadParameters [read, retain]
- (NSString *) blobUrl [read, retain]
- (NSString *) customData [read, write, retain]

Arbitrary data attached to this score submission

- (NSString *) displayText [read, write, retain]

Formatted string representation of score suitable for display

- (double) distance [read, assign]
- (NSString *) gameCenterId [read, retain]
- (NSString *) gameCenterName [read, write, retain]
- (NSUInteger) gameCenterSeconds [read, assign]
- (double) latitude [read, assign]
- (NSString *) leaderboardId [read, retain]
- (double) longitude [read, assign]
- (NSInteger) rank [read, assign]

Position on the leaderboard for this score. The best score has a rank of 1.

Note:
This field is only valid for scores that have been retrieved from the OpenFeint servers.
- (int64_t) score [read, write, assign]

Raw integral score value

- (NSString *) toHighRankText [read, retain]
- (OFUser *) user [read, assign]

OpenFeint User who submitted this score


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations Enumerator Properties