use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct GKTurnBasedMatchStatus(pub NSInteger);
impl GKTurnBasedMatchStatus {
#[doc(alias = "GKTurnBasedMatchStatusUnknown")]
pub const Unknown: Self = Self(0);
#[doc(alias = "GKTurnBasedMatchStatusOpen")]
pub const Open: Self = Self(1);
#[doc(alias = "GKTurnBasedMatchStatusEnded")]
pub const Ended: Self = Self(2);
#[doc(alias = "GKTurnBasedMatchStatusMatching")]
pub const Matching: Self = Self(3);
}
unsafe impl Encode for GKTurnBasedMatchStatus {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for GKTurnBasedMatchStatus {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct GKTurnBasedParticipantStatus(pub NSInteger);
impl GKTurnBasedParticipantStatus {
#[doc(alias = "GKTurnBasedParticipantStatusUnknown")]
pub const Unknown: Self = Self(0);
#[doc(alias = "GKTurnBasedParticipantStatusInvited")]
pub const Invited: Self = Self(1);
#[doc(alias = "GKTurnBasedParticipantStatusDeclined")]
pub const Declined: Self = Self(2);
#[doc(alias = "GKTurnBasedParticipantStatusMatching")]
pub const Matching: Self = Self(3);
#[doc(alias = "GKTurnBasedParticipantStatusActive")]
pub const Active: Self = Self(4);
#[doc(alias = "GKTurnBasedParticipantStatusDone")]
pub const Done: Self = Self(5);
}
unsafe impl Encode for GKTurnBasedParticipantStatus {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for GKTurnBasedParticipantStatus {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct GKTurnBasedMatchOutcome(pub NSInteger);
impl GKTurnBasedMatchOutcome {
#[doc(alias = "GKTurnBasedMatchOutcomeNone")]
pub const None: Self = Self(0);
#[doc(alias = "GKTurnBasedMatchOutcomeQuit")]
pub const Quit: Self = Self(1);
#[doc(alias = "GKTurnBasedMatchOutcomeWon")]
pub const Won: Self = Self(2);
#[doc(alias = "GKTurnBasedMatchOutcomeLost")]
pub const Lost: Self = Self(3);
#[doc(alias = "GKTurnBasedMatchOutcomeTied")]
pub const Tied: Self = Self(4);
#[doc(alias = "GKTurnBasedMatchOutcomeTimeExpired")]
pub const TimeExpired: Self = Self(5);
#[doc(alias = "GKTurnBasedMatchOutcomeFirst")]
pub const First: Self = Self(6);
#[doc(alias = "GKTurnBasedMatchOutcomeSecond")]
pub const Second: Self = Self(7);
#[doc(alias = "GKTurnBasedMatchOutcomeThird")]
pub const Third: Self = Self(8);
#[doc(alias = "GKTurnBasedMatchOutcomeFourth")]
pub const Fourth: Self = Self(9);
#[doc(alias = "GKTurnBasedMatchOutcomeCustomRange")]
pub const CustomRange: Self = Self(0x00FF0000);
}
unsafe impl Encode for GKTurnBasedMatchOutcome {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for GKTurnBasedMatchOutcome {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct GKTurnBasedParticipant;
);
extern_conformance!(
unsafe impl NSObjectProtocol for GKTurnBasedParticipant {}
);
impl GKTurnBasedParticipant {
extern_methods!(
#[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
#[unsafe(method(player))]
#[unsafe(method_family = none)]
pub unsafe fn player(&self) -> Option<Retained<GKPlayer>>;
#[unsafe(method(lastTurnDate))]
#[unsafe(method_family = none)]
pub unsafe fn lastTurnDate(&self) -> Option<Retained<NSDate>>;
#[unsafe(method(status))]
#[unsafe(method_family = none)]
pub unsafe fn status(&self) -> GKTurnBasedParticipantStatus;
#[unsafe(method(matchOutcome))]
#[unsafe(method_family = none)]
pub unsafe fn matchOutcome(&self) -> GKTurnBasedMatchOutcome;
#[unsafe(method(setMatchOutcome:))]
#[unsafe(method_family = none)]
pub unsafe fn setMatchOutcome(&self, match_outcome: GKTurnBasedMatchOutcome);
#[unsafe(method(timeoutDate))]
#[unsafe(method_family = none)]
pub unsafe fn timeoutDate(&self) -> Option<Retained<NSDate>>;
);
}
impl GKTurnBasedParticipant {
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>;
);
}
impl GKTurnBasedParticipant {
extern_methods!(
#[deprecated]
#[unsafe(method(playerID))]
#[unsafe(method_family = none)]
pub unsafe fn playerID(&self) -> Option<Retained<NSString>>;
);
}
extern_protocol!(
pub unsafe trait GKTurnBasedEventListener {
#[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
#[optional]
#[unsafe(method(player:didRequestMatchWithOtherPlayers:))]
#[unsafe(method_family = none)]
unsafe fn player_didRequestMatchWithOtherPlayers(
&self,
player: &GKPlayer,
players_to_invite: &NSArray<GKPlayer>,
);
#[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
#[optional]
#[unsafe(method(player:receivedTurnEventForMatch:didBecomeActive:))]
#[unsafe(method_family = none)]
unsafe fn player_receivedTurnEventForMatch_didBecomeActive(
&self,
player: &GKPlayer,
r#match: &GKTurnBasedMatch,
did_become_active: bool,
);
#[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
#[optional]
#[unsafe(method(player:matchEnded:))]
#[unsafe(method_family = none)]
unsafe fn player_matchEnded(&self, player: &GKPlayer, r#match: &GKTurnBasedMatch);
#[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
#[optional]
#[unsafe(method(player:receivedExchangeRequest:forMatch:))]
#[unsafe(method_family = none)]
unsafe fn player_receivedExchangeRequest_forMatch(
&self,
player: &GKPlayer,
exchange: &GKTurnBasedExchange,
r#match: &GKTurnBasedMatch,
);
#[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
#[optional]
#[unsafe(method(player:receivedExchangeCancellation:forMatch:))]
#[unsafe(method_family = none)]
unsafe fn player_receivedExchangeCancellation_forMatch(
&self,
player: &GKPlayer,
exchange: &GKTurnBasedExchange,
r#match: &GKTurnBasedMatch,
);
#[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
#[optional]
#[unsafe(method(player:receivedExchangeReplies:forCompletedExchange:forMatch:))]
#[unsafe(method_family = none)]
unsafe fn player_receivedExchangeReplies_forCompletedExchange_forMatch(
&self,
player: &GKPlayer,
replies: &NSArray<GKTurnBasedExchangeReply>,
exchange: &GKTurnBasedExchange,
r#match: &GKTurnBasedMatch,
);
#[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
#[optional]
#[unsafe(method(player:wantsToQuitMatch:))]
#[unsafe(method_family = none)]
unsafe fn player_wantsToQuitMatch(&self, player: &GKPlayer, r#match: &GKTurnBasedMatch);
#[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
#[deprecated]
#[optional]
#[unsafe(method(player:didRequestMatchWithPlayers:))]
#[unsafe(method_family = none)]
unsafe fn player_didRequestMatchWithPlayers(
&self,
player: &GKPlayer,
player_i_ds_to_invite: &NSArray<NSString>,
);
}
);
extern "C" {
pub static GKTurnTimeoutDefault: NSTimeInterval;
}
extern "C" {
pub static GKTurnTimeoutNone: NSTimeInterval;
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct GKTurnBasedMatch;
);
extern_conformance!(
unsafe impl NSObjectProtocol for GKTurnBasedMatch {}
);
impl GKTurnBasedMatch {
extern_methods!(
#[unsafe(method(matchID))]
#[unsafe(method_family = none)]
pub unsafe fn matchID(&self) -> Retained<NSString>;
#[unsafe(method(creationDate))]
#[unsafe(method_family = none)]
pub unsafe fn creationDate(&self) -> Retained<NSDate>;
#[unsafe(method(participants))]
#[unsafe(method_family = none)]
pub unsafe fn participants(&self) -> Retained<NSArray<GKTurnBasedParticipant>>;
#[unsafe(method(status))]
#[unsafe(method_family = none)]
pub unsafe fn status(&self) -> GKTurnBasedMatchStatus;
#[unsafe(method(currentParticipant))]
#[unsafe(method_family = none)]
pub unsafe fn currentParticipant(&self) -> Option<Retained<GKTurnBasedParticipant>>;
#[unsafe(method(matchData))]
#[unsafe(method_family = none)]
pub unsafe fn matchData(&self) -> Option<Retained<NSData>>;
#[unsafe(method(setLocalizableMessageWithKey:arguments:))]
#[unsafe(method_family = none)]
pub unsafe fn setLocalizableMessageWithKey_arguments(
&self,
key: &NSString,
arguments: Option<&NSArray<NSString>>,
);
#[unsafe(method(message))]
#[unsafe(method_family = none)]
pub unsafe fn message(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setMessage:))]
#[unsafe(method_family = none)]
pub unsafe fn setMessage(&self, message: Option<&NSString>);
#[unsafe(method(matchDataMaximumSize))]
#[unsafe(method_family = none)]
pub unsafe fn matchDataMaximumSize(&self) -> NSUInteger;
#[unsafe(method(exchanges))]
#[unsafe(method_family = none)]
pub unsafe fn exchanges(&self) -> Option<Retained<NSArray<GKTurnBasedExchange>>>;
#[unsafe(method(activeExchanges))]
#[unsafe(method_family = none)]
pub unsafe fn activeExchanges(&self) -> Option<Retained<NSArray<GKTurnBasedExchange>>>;
#[unsafe(method(completedExchanges))]
#[unsafe(method_family = none)]
pub unsafe fn completedExchanges(&self) -> Option<Retained<NSArray<GKTurnBasedExchange>>>;
#[unsafe(method(exchangeDataMaximumSize))]
#[unsafe(method_family = none)]
pub unsafe fn exchangeDataMaximumSize(&self) -> NSUInteger;
#[unsafe(method(exchangeMaxInitiatedExchangesPerPlayer))]
#[unsafe(method_family = none)]
pub unsafe fn exchangeMaxInitiatedExchangesPerPlayer(&self) -> NSUInteger;
#[cfg(all(feature = "GKMatchmaker", feature = "block2"))]
#[unsafe(method(findMatchForRequest:withCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn findMatchForRequest_withCompletionHandler(
request: &GKMatchRequest,
completion_handler: &block2::DynBlock<dyn Fn(*mut GKTurnBasedMatch, *mut NSError)>,
);
#[cfg(feature = "block2")]
#[unsafe(method(loadMatchesWithCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn loadMatchesWithCompletionHandler(
completion_handler: Option<
&block2::DynBlock<dyn Fn(*mut NSArray<GKTurnBasedMatch>, *mut NSError)>,
>,
);
#[cfg(feature = "block2")]
#[unsafe(method(loadMatchWithID:withCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn loadMatchWithID_withCompletionHandler(
match_id: &NSString,
completion_handler: Option<
&block2::DynBlock<dyn Fn(*mut GKTurnBasedMatch, *mut NSError)>,
>,
);
#[cfg(feature = "block2")]
#[unsafe(method(rematchWithCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn rematchWithCompletionHandler(
&self,
completion_handler: Option<
&block2::DynBlock<dyn Fn(*mut GKTurnBasedMatch, *mut NSError)>,
>,
);
#[cfg(feature = "block2")]
#[unsafe(method(acceptInviteWithCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn acceptInviteWithCompletionHandler(
&self,
completion_handler: Option<
&block2::DynBlock<dyn Fn(*mut GKTurnBasedMatch, *mut NSError)>,
>,
);
#[cfg(feature = "block2")]
#[unsafe(method(declineInviteWithCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn declineInviteWithCompletionHandler(
&self,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[cfg(feature = "block2")]
#[unsafe(method(removeWithCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn removeWithCompletionHandler(
&self,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[cfg(feature = "block2")]
#[unsafe(method(loadMatchDataWithCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn loadMatchDataWithCompletionHandler(
&self,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>>,
);
#[cfg(feature = "block2")]
#[unsafe(method(endTurnWithNextParticipants:turnTimeout:matchData:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn endTurnWithNextParticipants_turnTimeout_matchData_completionHandler(
&self,
next_participants: &NSArray<GKTurnBasedParticipant>,
timeout: NSTimeInterval,
match_data: &NSData,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[cfg(feature = "block2")]
#[unsafe(method(participantQuitInTurnWithOutcome:nextParticipants:turnTimeout:matchData:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn participantQuitInTurnWithOutcome_nextParticipants_turnTimeout_matchData_completionHandler(
&self,
match_outcome: GKTurnBasedMatchOutcome,
next_participants: &NSArray<GKTurnBasedParticipant>,
timeout: NSTimeInterval,
match_data: &NSData,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[cfg(feature = "block2")]
#[unsafe(method(participantQuitOutOfTurnWithOutcome:withCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn participantQuitOutOfTurnWithOutcome_withCompletionHandler(
&self,
match_outcome: GKTurnBasedMatchOutcome,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[cfg(feature = "block2")]
#[unsafe(method(endMatchInTurnWithMatchData:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn endMatchInTurnWithMatchData_completionHandler(
&self,
match_data: &NSData,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[cfg(all(feature = "GKAchievement", feature = "GKScore", feature = "block2"))]
#[deprecated]
#[unsafe(method(endMatchInTurnWithMatchData:scores:achievements:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn endMatchInTurnWithMatchData_scores_achievements_completionHandler(
&self,
match_data: &NSData,
scores: Option<&NSArray<GKScore>>,
achievements: Option<&NSArray<GKAchievement>>,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[cfg(all(feature = "GKLeaderboardScore", feature = "block2"))]
#[unsafe(method(endMatchInTurnWithMatchData:leaderboardScores:achievements:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn endMatchInTurnWithMatchData_leaderboardScores_achievements_completionHandler(
&self,
match_data: &NSData,
scores: &NSArray<GKLeaderboardScore>,
achievements: &NSArray,
completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
);
#[cfg(feature = "block2")]
#[unsafe(method(saveCurrentTurnWithMatchData:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn saveCurrentTurnWithMatchData_completionHandler(
&self,
match_data: &NSData,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[cfg(feature = "block2")]
#[unsafe(method(saveMergedMatchData:withResolvedExchanges:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn saveMergedMatchData_withResolvedExchanges_completionHandler(
&self,
match_data: &NSData,
exchanges: &NSArray<GKTurnBasedExchange>,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[cfg(feature = "block2")]
#[unsafe(method(sendExchangeToParticipants:data:localizableMessageKey:arguments:timeout:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn sendExchangeToParticipants_data_localizableMessageKey_arguments_timeout_completionHandler(
&self,
participants: &NSArray<GKTurnBasedParticipant>,
data: &NSData,
key: &NSString,
arguments: &NSArray<NSString>,
timeout: NSTimeInterval,
completion_handler: Option<
&block2::DynBlock<dyn Fn(*mut GKTurnBasedExchange, *mut NSError)>,
>,
);
#[cfg(feature = "block2")]
#[unsafe(method(sendReminderToParticipants:localizableMessageKey:arguments:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn sendReminderToParticipants_localizableMessageKey_arguments_completionHandler(
&self,
participants: &NSArray<GKTurnBasedParticipant>,
key: &NSString,
arguments: &NSArray<NSString>,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[cfg(feature = "block2")]
#[deprecated]
#[unsafe(method(endTurnWithNextParticipant:matchData:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn endTurnWithNextParticipant_matchData_completionHandler(
&self,
next_participant: &GKTurnBasedParticipant,
match_data: &NSData,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[cfg(feature = "block2")]
#[deprecated]
#[unsafe(method(participantQuitInTurnWithOutcome:nextParticipant:matchData:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn participantQuitInTurnWithOutcome_nextParticipant_matchData_completionHandler(
&self,
match_outcome: GKTurnBasedMatchOutcome,
next_participant: &GKTurnBasedParticipant,
match_data: &NSData,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
);
}
impl GKTurnBasedMatch {
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>;
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct GKTurnBasedExchangeStatus(pub i8);
impl GKTurnBasedExchangeStatus {
#[doc(alias = "GKTurnBasedExchangeStatusUnknown")]
pub const Unknown: Self = Self(0);
#[doc(alias = "GKTurnBasedExchangeStatusActive")]
pub const Active: Self = Self(1);
#[doc(alias = "GKTurnBasedExchangeStatusComplete")]
pub const Complete: Self = Self(2);
#[doc(alias = "GKTurnBasedExchangeStatusResolved")]
pub const Resolved: Self = Self(3);
#[doc(alias = "GKTurnBasedExchangeStatusCanceled")]
pub const Canceled: Self = Self(4);
}
unsafe impl Encode for GKTurnBasedExchangeStatus {
const ENCODING: Encoding = i8::ENCODING;
}
unsafe impl RefEncode for GKTurnBasedExchangeStatus {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern "C" {
pub static GKExchangeTimeoutDefault: NSTimeInterval;
}
extern "C" {
pub static GKExchangeTimeoutNone: NSTimeInterval;
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct GKTurnBasedExchange;
);
extern_conformance!(
unsafe impl NSObjectProtocol for GKTurnBasedExchange {}
);
impl GKTurnBasedExchange {
extern_methods!(
#[unsafe(method(exchangeID))]
#[unsafe(method_family = none)]
pub unsafe fn exchangeID(&self) -> Retained<NSString>;
#[unsafe(method(sender))]
#[unsafe(method_family = none)]
pub unsafe fn sender(&self) -> Retained<GKTurnBasedParticipant>;
#[unsafe(method(recipients))]
#[unsafe(method_family = none)]
pub unsafe fn recipients(&self) -> Retained<NSArray<GKTurnBasedParticipant>>;
#[unsafe(method(status))]
#[unsafe(method_family = none)]
pub unsafe fn status(&self) -> GKTurnBasedExchangeStatus;
#[unsafe(method(message))]
#[unsafe(method_family = none)]
pub unsafe fn message(&self) -> Option<Retained<NSString>>;
#[unsafe(method(data))]
#[unsafe(method_family = none)]
pub unsafe fn data(&self) -> Option<Retained<NSData>>;
#[unsafe(method(sendDate))]
#[unsafe(method_family = none)]
pub unsafe fn sendDate(&self) -> Retained<NSDate>;
#[unsafe(method(timeoutDate))]
#[unsafe(method_family = none)]
pub unsafe fn timeoutDate(&self) -> Option<Retained<NSDate>>;
#[unsafe(method(completionDate))]
#[unsafe(method_family = none)]
pub unsafe fn completionDate(&self) -> Option<Retained<NSDate>>;
#[unsafe(method(replies))]
#[unsafe(method_family = none)]
pub unsafe fn replies(&self) -> Option<Retained<NSArray<GKTurnBasedExchangeReply>>>;
#[cfg(feature = "block2")]
#[unsafe(method(cancelWithLocalizableMessageKey:arguments:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn cancelWithLocalizableMessageKey_arguments_completionHandler(
&self,
key: &NSString,
arguments: &NSArray<NSString>,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[cfg(feature = "block2")]
#[unsafe(method(replyWithLocalizableMessageKey:arguments:data:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn replyWithLocalizableMessageKey_arguments_data_completionHandler(
&self,
key: &NSString,
arguments: &NSArray<NSString>,
data: &NSData,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
);
}
impl GKTurnBasedExchange {
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>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct GKTurnBasedExchangeReply;
);
extern_conformance!(
unsafe impl NSObjectProtocol for GKTurnBasedExchangeReply {}
);
impl GKTurnBasedExchangeReply {
extern_methods!(
#[unsafe(method(recipient))]
#[unsafe(method_family = none)]
pub unsafe fn recipient(&self) -> Retained<GKTurnBasedParticipant>;
#[unsafe(method(message))]
#[unsafe(method_family = none)]
pub unsafe fn message(&self) -> Option<Retained<NSString>>;
#[unsafe(method(data))]
#[unsafe(method_family = none)]
pub unsafe fn data(&self) -> Option<Retained<NSData>>;
#[unsafe(method(replyDate))]
#[unsafe(method_family = none)]
pub unsafe fn replyDate(&self) -> Retained<NSDate>;
);
}
impl GKTurnBasedExchangeReply {
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>;
);
}
extern_protocol!(
#[deprecated]
pub unsafe trait GKTurnBasedEventHandlerDelegate {
#[deprecated]
#[unsafe(method(handleInviteFromGameCenter:))]
#[unsafe(method_family = none)]
unsafe fn handleInviteFromGameCenter(&self, players_to_invite: &NSArray<NSString>);
#[deprecated]
#[unsafe(method(handleTurnEventForMatch:didBecomeActive:))]
#[unsafe(method_family = none)]
unsafe fn handleTurnEventForMatch_didBecomeActive(
&self,
r#match: &GKTurnBasedMatch,
did_become_active: bool,
);
#[deprecated]
#[optional]
#[unsafe(method(handleTurnEventForMatch:))]
#[unsafe(method_family = none)]
unsafe fn handleTurnEventForMatch(&self, r#match: &GKTurnBasedMatch);
#[deprecated]
#[optional]
#[unsafe(method(handleMatchEnded:))]
#[unsafe(method_family = none)]
unsafe fn handleMatchEnded(&self, r#match: &GKTurnBasedMatch);
}
);
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated]
pub struct GKTurnBasedEventHandler;
);
extern_conformance!(
unsafe impl NSObjectProtocol for GKTurnBasedEventHandler {}
);
impl GKTurnBasedEventHandler {
extern_methods!(
#[deprecated]
#[unsafe(method(sharedTurnBasedEventHandler))]
#[unsafe(method_family = none)]
pub unsafe fn sharedTurnBasedEventHandler() -> Retained<GKTurnBasedEventHandler>;
#[deprecated]
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub unsafe fn delegate(&self) -> Option<Retained<NSObject>>;
#[deprecated]
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub unsafe fn setDelegate(&self, delegate: Option<&NSObject>);
);
}
impl GKTurnBasedEventHandler {
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>;
);
}