Public Member Functions | Static Public Member Functions | Protected Attributes | Properties

OFLeaderboard Class Reference

#import <OFLeaderboard.h>

List of all members.

Public Member Functions

(OFHighScore *) - highScoreForCurrentUser
(NSArray *) - locallySubmittedScores
(OFRequestHandle *) - downloadHighScoresWithFilter:
(id) - initWithLocalSQL:localUserScore:comparedUserScore:
(bool) - isComparison
(OFUser *) - comparedToUser

Static Public Member Functions

(void) + setDelegate:
(NSArray *) + leaderboards
(OFLeaderboard *) + leaderboard:
(NSString *) + getResourceName

Protected Attributes

OFHighScorecomparedUserScore

Properties

NSString * name
NSString * leaderboardId
OFHighScorecurrentUserScore
BOOL descendingScoreOrder
OFScoreFilter filter

Detailed Description

The public interface for OFLeaderboard allows you to query leaderboars and submit new scores to a leaderboard.


Member Function Documentation

- (OFUser*) comparedToUser
- (OFRequestHandle*) downloadHighScoresWithFilter: (OFScoreFilter downloadFilter

Retrieves, at most, the highest scores for a given leaderboard. If you need more than the top 25 scores you should use an OFScoreEnumerator object.

Parameters:
downloadFilterSet the filter for the leaderboard to download for. This filter type will be preserved on the leaderboard.
Returns:
OFRequestHandle for the server request. Use this to cancel the request
Note:
Invokes -(void)didDownloadHighScores:(NSArray*)highScores forOFLeaderboard:(OFLeaderboard*)leaderboard on success -(void)didFailDownloadHighScoresForOFLeaderboard:(OFLeaderboard*)leaderboard on failure.
See also:
OFScoreEnumerator
OFRequestHandle
+ (NSString*) getResourceName
- (OFHighScore*) highScoreForCurrentUser

Retrieves the current user's high score for a given leaderboard.

Note:
The rank property on the OFHighScore object returned from this method will not be set.
Returns:
OFHighScore objects containing the local user's high score for a given leaderboard.
- (id) initWithLocalSQL: (OFSqlQuery *)  queryRow
localUserScore: (OFHighScore *)  locUserScore
comparedUserScore: (OFHighScore *)  compUserScore 
- (bool) isComparison
+ (OFLeaderboard*) leaderboard: (NSString *)  leaderboardID

Retrieves a leaderboard based on the leaderboard id on the developer dashboard

Parameters:
leaderboardIDThe leaderboard id
Returns:
OFLeaderboard corrisponding to the leaderboard id
+ (NSArray*) leaderboards

Retrieves the application's leaderboard list

Returns:
NSArray of OFLeaderboard objects
- (NSArray*) locallySubmittedScores

Retrieves the locally submitted high score list for the given leaderboard. These scores are the 10 best scores (for leaderboards with Allow Worse Scores unchecked) or 10 most recent scores (for leaderboards with Allow Worse Scores checked) for the local user.

Returns:
NSArray of OFHighScore objects representing the local top 10 scores for the local user
+ (void) setDelegate: (id< OFLeaderboardDelegate >)  delegate

Set a delegate for all OFLeaderboard related actions. Must adopt the OFLeaderboardDelegate protocol.

Note:
Defaults to nil. Weak reference

Member Data Documentation

- (OFHighScore*) comparedUserScore [protected]

Property Documentation

- (OFHighScore *) currentUserScore [read, assign]

High score of the current user on this leaderboard

Note:
A value of nil means the local user has not submitted a score for this leaderboard
- (BOOL) descendingScoreOrder [read, assign]

If YES then the highest score value is ranked #1, if NO then the lowest score value is ranked #1.

- (OFScoreFilter) filter [read, assign]

D/////////////////////////////////////////////////////// Determines which set of scores will be chosen from when downloading scores.

Note:
Defaults to OFScoreFilter_Everyone
- (NSString*) leaderboardId [read, assign]

Leaderboard ID

- (NSString *) name [read, assign]

Name of this leaderboard


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