cocos2d for iPhone 1.0.0
2D engine for iOS and OS X
Public Member Functions | Static Public Member Functions | Protected Attributes | Properties
CLScoreServerRequest Class Reference

#import <CLScoreServerRequest.h>

List of all members.

Public Member Functions

(id) - initWithGameName:delegate:
(BOOL) - requestScores:limit:offset:flags:category:
(BOOL) - requestScores:limit:offset:flags:
(NSArray *) - parseScores
(BOOL) - requestRankForScore:andCategory:
(int) - parseRank

Static Public Member Functions

(id) + serverWithGameName:delegate:

Protected Attributes

NSString * gameName
 game name, used as a login name.
id delegate
 delegate instance of fetch score
NSURLConnection * connection_
 the connection

Properties

NSURLConnection * connection

Detailed Description

Handles the Request Scores to the cocos live server

Definition at line 62 of file CLScoreServerRequest.h.


Member Function Documentation

- (id) initWithGameName: (NSString *)  name
delegate: (id)  delegate 

initializes a ScoreServerRequest with a game name

- (int) parseRank

It's actually not parsing anything, just returning int for a rank. Kept name PARSE for convinience with parseScores

- (NSArray*) parseScores

parse the received JSON scores and convert it to objective-c objects

- (BOOL) requestRankForScore: (int)  score
andCategory: (NSString *)  category 

request rank for a given score using a predefined query. This is an asyncronous request. score: int for a score category: an NSString. For example: 'easy', 'medium', 'type1'... When requesting ranks, they can be filtered by this field.

- (BOOL) requestScores: (tQueryType)  type
limit: (int)  limit
offset: (int)  offset
flags: (tQueryFlags)  flags 

request scores from server using a predefined query. This is an asyncronous request. limit: how many scores are being requested. Maximun is 100 flags: can be kQueryFlagByCountry (fetches only scores from country)

- (BOOL) requestScores: (tQueryType)  type
limit: (int)  limit
offset: (int)  offset
flags: (tQueryFlags)  flags
category: (NSString *)  category 

request scores from server using a predefined query. This is an asyncronous request. limit: how many scores are being requested. Maximun is 100 flags: can be kQueryFlagByCountry (fetches only scores from country) category: an NSString. For example: 'easy', 'medium', 'type1'... When requesting scores, they can be filtered by this field.

+ (id) serverWithGameName: (NSString *)  name
delegate: (id)  delegate 

creates a ScoreServerRequest server with a game name


Member Data Documentation

- (NSURLConnection*) connection_ [protected]

the connection

Definition at line 77 of file CLScoreServerRequest.h.

- (id) delegate [protected]

delegate instance of fetch score

Definition at line 68 of file CLScoreServerRequest.h.

- (NSString*) gameName [protected]

game name, used as a login name.

Definition at line 65 of file CLScoreServerRequest.h.


Property Documentation

- (NSURLConnection*) connection [read, write, retain]

connection to the server

Definition at line 81 of file CLScoreServerRequest.h.


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

cocos2d for iPhone API Reference - Generated using Doxygen 1.7.4