objc2_game_kit/generated/
GKLeaderboardScore.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// A `GKLeaderboardScore` object represents a score on a leaderboard for scores you report for challenges or turn-based games.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamekit/gkleaderboardscore?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct GKLeaderboardScore;
17);
18
19extern_conformance!(
20    unsafe impl NSObjectProtocol for GKLeaderboardScore {}
21);
22
23impl GKLeaderboardScore {
24    extern_methods!(
25        #[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
26        /// The player who earns the score.
27        #[unsafe(method(player))]
28        #[unsafe(method_family = none)]
29        pub unsafe fn player(&self) -> Retained<GKPlayer>;
30
31        #[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
32        /// Setter for [`player`][Self::player].
33        #[unsafe(method(setPlayer:))]
34        #[unsafe(method_family = none)]
35        pub unsafe fn setPlayer(&self, player: &GKPlayer);
36
37        /// The score that the player earns.
38        #[unsafe(method(value))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn value(&self) -> NSInteger;
41
42        /// Setter for [`value`][Self::value].
43        #[unsafe(method(setValue:))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn setValue(&self, value: NSInteger);
46
47        /// An integer value that your game uses.
48        #[unsafe(method(context))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn context(&self) -> NSUInteger;
51
52        /// Setter for [`context`][Self::context].
53        #[unsafe(method(setContext:))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn setContext(&self, context: NSUInteger);
56
57        /// The ID that Game Center uses for the leaderboard.
58        #[unsafe(method(leaderboardID))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn leaderboardID(&self) -> Retained<NSString>;
61
62        /// Setter for [`leaderboardID`][Self::leaderboardID].
63        #[unsafe(method(setLeaderboardID:))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn setLeaderboardID(&self, leaderboard_id: &NSString);
66    );
67}
68
69/// Methods declared on superclass `NSObject`.
70impl GKLeaderboardScore {
71    extern_methods!(
72        #[unsafe(method(init))]
73        #[unsafe(method_family = init)]
74        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
75
76        #[unsafe(method(new))]
77        #[unsafe(method_family = new)]
78        pub unsafe fn new() -> Retained<Self>;
79    );
80}