-
Notifications
You must be signed in to change notification settings - Fork 18
/
DDGameKitHelper.h
executable file
·62 lines (42 loc) · 1.69 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
57
58
59
60
61
62
//
// 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, GKGameCenterControllerDelegate>
{
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) showGameCenter;
-(void) showLeaderboard;
-(void) showLeaderboardwithCategory:(NSString*)category timeScope:(int)tscope;
-(void) showAchievements;
-(GKAchievementDescription*) getAchievementDescription:(NSString*)identifier;
- (int) numberOfTotalAchievements;
- (int) numberOfCompletedAchievements;
@end