forked from funkyvisions/DDGameKitHelper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DDGameKitHelper.h
56 lines (39 loc) · 1.56 KB
/
DDGameKitHelper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//
// DDGameKitHelper.h
// Version 1.0
//
// Inspired by Steffen Itterheim's GameKitHelper
#import <GameKit/GameKit.h>
@protocol DDGameKitHelperProtocol
-(bool) compare:(int64_t)score1 to:(int64_t)score2;
-(void) onSubmitScore:(int64_t)score;
-(void) onReportAchievement:(GKAchievement*)achievement;
@end
@interface DDGameKitHelper : NSObject <GKLeaderboardViewControllerDelegate, GKAchievementViewControllerDelegate>
{
id<DDGameKitHelperProtocol> delegate;
bool isGameCenterAvailable;
NSMutableDictionary* achievements;
NSMutableDictionary* scores;
NSMutableDictionary* achievementDescriptions;
NSString* currentPlayerID;
}
@property (nonatomic, retain) id<DDGameKitHelperProtocol> delegate;
@property (nonatomic, readonly) bool isGameCenterAvailable;
@property (nonatomic, readonly) NSMutableDictionary* achievements;
@property (nonatomic, readonly) NSMutableDictionary* scores;
@property (nonatomic, readonly) NSMutableDictionary* achievementDescriptions;
@property (nonatomic, retain) NSString* currentPlayerID;
+(DDGameKitHelper*) sharedGameKitHelper;
-(void) setNotAvailable;
-(bool) isAvailable;
-(void) authenticateLocalPlayer;
-(bool) isLocalPlayerAuthenticated;
-(void) submitScore:(int64_t)value category:(NSString*)category;
-(void) reportAchievement:(NSString*)identifier percentComplete:(float)percent;
-(void) resetAchievements;
-(void) showLeaderboard;
-(void) showLeaderboardwithCategory:(NSString*)category timeScope:(int)tscope;
-(void) showAchievements;
-(GKAchievementDescription*) getAchievementDescription:(NSString*)identifier;
@end