objc2_game_kit/generated/
GKScore.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 #[deprecated]
17 pub struct GKScore;
18);
19
20extern_conformance!(
21 unsafe impl NSCoding for GKScore {}
22);
23
24extern_conformance!(
25 unsafe impl NSObjectProtocol for GKScore {}
26);
27
28extern_conformance!(
29 unsafe impl NSSecureCoding for GKScore {}
30);
31
32impl GKScore {
33 extern_methods!(
34 #[deprecated]
36 #[unsafe(method(initWithLeaderboardIdentifier:))]
37 #[unsafe(method_family = init)]
38 pub unsafe fn initWithLeaderboardIdentifier(
39 this: Allocated<Self>,
40 identifier: &NSString,
41 ) -> Retained<Self>;
42
43 #[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
44 #[deprecated]
46 #[unsafe(method(initWithLeaderboardIdentifier:player:))]
47 #[unsafe(method_family = init)]
48 pub unsafe fn initWithLeaderboardIdentifier_player(
49 this: Allocated<Self>,
50 identifier: &NSString,
51 player: &GKPlayer,
52 ) -> Retained<Self>;
53
54 #[deprecated]
56 #[unsafe(method(value))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn value(&self) -> i64;
59
60 #[deprecated]
62 #[unsafe(method(setValue:))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn setValue(&self, value: i64);
65
66 #[deprecated]
68 #[unsafe(method(formattedValue))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn formattedValue(&self) -> Option<Retained<NSString>>;
71
72 #[deprecated]
74 #[unsafe(method(leaderboardIdentifier))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn leaderboardIdentifier(&self) -> Retained<NSString>;
77
78 #[deprecated]
82 #[unsafe(method(setLeaderboardIdentifier:))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn setLeaderboardIdentifier(&self, leaderboard_identifier: &NSString);
85
86 #[deprecated]
88 #[unsafe(method(context))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn context(&self) -> u64;
91
92 #[deprecated]
94 #[unsafe(method(setContext:))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn setContext(&self, context: u64);
97
98 #[deprecated]
100 #[unsafe(method(date))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn date(&self) -> Retained<NSDate>;
103
104 #[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
105 #[deprecated]
107 #[unsafe(method(player))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn player(&self) -> Retained<GKPlayer>;
110
111 #[deprecated]
113 #[unsafe(method(rank))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn rank(&self) -> NSInteger;
116
117 #[deprecated]
120 #[unsafe(method(shouldSetDefaultLeaderboard))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn shouldSetDefaultLeaderboard(&self) -> bool;
123
124 #[deprecated]
126 #[unsafe(method(setShouldSetDefaultLeaderboard:))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn setShouldSetDefaultLeaderboard(&self, should_set_default_leaderboard: bool);
129
130 #[cfg(feature = "block2")]
131 #[deprecated]
137 #[unsafe(method(reportScores:withCompletionHandler:))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn reportScores_withCompletionHandler(
140 scores: &NSArray<GKScore>,
141 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
142 );
143 );
144}
145
146impl GKScore {
148 extern_methods!(
149 #[unsafe(method(init))]
150 #[unsafe(method_family = init)]
151 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
152
153 #[unsafe(method(new))]
154 #[unsafe(method_family = new)]
155 pub unsafe fn new() -> Retained<Self>;
156 );
157}
158
159#[deprecated]
161impl GKScore {
162 extern_methods!(
163 #[cfg(feature = "block2")]
164 #[deprecated]
165 #[unsafe(method(reportScoreWithCompletionHandler:))]
166 #[unsafe(method_family = none)]
167 pub unsafe fn reportScoreWithCompletionHandler(
168 &self,
169 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
170 );
171
172 #[deprecated]
173 #[unsafe(method(initWithCategory:))]
174 #[unsafe(method_family = init)]
175 pub unsafe fn initWithCategory(
176 this: Allocated<Self>,
177 category: Option<&NSString>,
178 ) -> Retained<Self>;
179
180 #[deprecated]
181 #[unsafe(method(category))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn category(&self) -> Option<Retained<NSString>>;
184
185 #[deprecated]
189 #[unsafe(method(setCategory:))]
190 #[unsafe(method_family = none)]
191 pub unsafe fn setCategory(&self, category: Option<&NSString>);
192 );
193}
194
195impl GKScore {
197 extern_methods!(
198 #[deprecated]
200 #[unsafe(method(initWithLeaderboardIdentifier:forPlayer:))]
201 #[unsafe(method_family = init)]
202 pub unsafe fn initWithLeaderboardIdentifier_forPlayer(
203 this: Allocated<Self>,
204 identifier: &NSString,
205 player_id: &NSString,
206 ) -> Option<Retained<Self>>;
207
208 #[deprecated]
210 #[unsafe(method(playerID))]
211 #[unsafe(method_family = none)]
212 pub unsafe fn playerID(&self) -> Option<Retained<NSString>>;
213 );
214}