objc2-game-kit 0.3.2

Bindings to the GameKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// A `GKLeaderboardScore` object represents a score on a leaderboard for scores you report for challenges or turn-based games.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamekit/gkleaderboardscore?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct GKLeaderboardScore;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for GKLeaderboardScore {}
);

impl GKLeaderboardScore {
    extern_methods!(
        #[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
        /// The player who earns the score.
        #[unsafe(method(player))]
        #[unsafe(method_family = none)]
        pub unsafe fn player(&self) -> Retained<GKPlayer>;

        #[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
        /// Setter for [`player`][Self::player].
        #[unsafe(method(setPlayer:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPlayer(&self, player: &GKPlayer);

        /// The score that the player earns.
        #[unsafe(method(value))]
        #[unsafe(method_family = none)]
        pub unsafe fn value(&self) -> NSInteger;

        /// Setter for [`value`][Self::value].
        #[unsafe(method(setValue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setValue(&self, value: NSInteger);

        /// An integer value that your game uses.
        #[unsafe(method(context))]
        #[unsafe(method_family = none)]
        pub unsafe fn context(&self) -> NSUInteger;

        /// Setter for [`context`][Self::context].
        #[unsafe(method(setContext:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setContext(&self, context: NSUInteger);

        /// The ID that Game Center uses for the leaderboard.
        #[unsafe(method(leaderboardID))]
        #[unsafe(method_family = none)]
        pub unsafe fn leaderboardID(&self) -> Retained<NSString>;

        /// Setter for [`leaderboardID`][Self::leaderboardID].
        #[unsafe(method(setLeaderboardID:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLeaderboardID(&self, leaderboard_id: &NSString);
    );
}

/// Methods declared on superclass `NSObject`.
impl GKLeaderboardScore {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}