GKTurnBasedEventListener

Trait GKTurnBasedEventListener 

Source
pub unsafe trait GKTurnBasedEventListener {
    // Provided methods
    unsafe fn player_didRequestMatchWithOtherPlayers(
        &self,
        player: &GKPlayer,
        players_to_invite: &NSArray<GKPlayer>,
    )
       where Self: Sized + Message { ... }
    unsafe fn player_receivedTurnEventForMatch_didBecomeActive(
        &self,
        player: &GKPlayer,
        match: &GKTurnBasedMatch,
        did_become_active: bool,
    )
       where Self: Sized + Message { ... }
    unsafe fn player_matchEnded(
        &self,
        player: &GKPlayer,
        match: &GKTurnBasedMatch,
    )
       where Self: Sized + Message { ... }
    unsafe fn player_receivedExchangeRequest_forMatch(
        &self,
        player: &GKPlayer,
        exchange: &GKTurnBasedExchange,
        match: &GKTurnBasedMatch,
    )
       where Self: Sized + Message { ... }
    unsafe fn player_receivedExchangeCancellation_forMatch(
        &self,
        player: &GKPlayer,
        exchange: &GKTurnBasedExchange,
        match: &GKTurnBasedMatch,
    )
       where Self: Sized + Message { ... }
    unsafe fn player_receivedExchangeReplies_forCompletedExchange_forMatch(
        &self,
        player: &GKPlayer,
        replies: &NSArray<GKTurnBasedExchangeReply>,
        exchange: &GKTurnBasedExchange,
        match: &GKTurnBasedMatch,
    )
       where Self: Sized + Message { ... }
    unsafe fn player_wantsToQuitMatch(
        &self,
        player: &GKPlayer,
        match: &GKTurnBasedMatch,
    )
       where Self: Sized + Message { ... }
    unsafe fn player_didRequestMatchWithPlayers(
        &self,
        player: &GKPlayer,
        player_i_ds_to_invite: &NSArray<NSString>,
    )
       where Self: Sized + Message { ... }
}
Available on crate feature GKTurnBasedMatch only.
Expand description

Provided Methods§

Source

unsafe fn player_didRequestMatchWithOtherPlayers( &self, player: &GKPlayer, players_to_invite: &NSArray<GKPlayer>, )
where Self: Sized + Message,

Available on crate features GKBasePlayer and GKPlayer only.

If Game Center initiates a match the developer should create a GKTurnBasedMatch from playersToInvite and present a GKTurnbasedMatchmakerViewController.

Source

unsafe fn player_receivedTurnEventForMatch_didBecomeActive( &self, player: &GKPlayer, match: &GKTurnBasedMatch, did_become_active: bool, )
where Self: Sized + Message,

Available on crate features GKBasePlayer and GKPlayer only.

called when it becomes this player’s turn. It also gets called under the following conditions: the player’s turn has a timeout and it is about to expire. the player accepts an invite from another player. when the game is running it will additionally recieve turn events for the following: turn was passed to another player another player saved the match data Because of this the app needs to be prepared to handle this even while the player is taking a turn in an existing match. The boolean indicates whether this event launched or brought to forground the app.

Source

unsafe fn player_matchEnded(&self, player: &GKPlayer, match: &GKTurnBasedMatch)
where Self: Sized + Message,

Available on crate features GKBasePlayer and GKPlayer only.

called when the match has ended.

Source

unsafe fn player_receivedExchangeRequest_forMatch( &self, player: &GKPlayer, exchange: &GKTurnBasedExchange, match: &GKTurnBasedMatch, )
where Self: Sized + Message,

Available on crate features GKBasePlayer and GKPlayer only.

this is called when a player receives an exchange request from another player.

Source

unsafe fn player_receivedExchangeCancellation_forMatch( &self, player: &GKPlayer, exchange: &GKTurnBasedExchange, match: &GKTurnBasedMatch, )
where Self: Sized + Message,

Available on crate features GKBasePlayer and GKPlayer only.

this is called when an exchange is canceled by the sender.

Source

unsafe fn player_receivedExchangeReplies_forCompletedExchange_forMatch( &self, player: &GKPlayer, replies: &NSArray<GKTurnBasedExchangeReply>, exchange: &GKTurnBasedExchange, match: &GKTurnBasedMatch, )
where Self: Sized + Message,

Available on crate features GKBasePlayer and GKPlayer only.

called when all players either respond or timeout responding to this request. This is sent to both the turn holder and the initiator of the exchange

Source

unsafe fn player_wantsToQuitMatch( &self, player: &GKPlayer, match: &GKTurnBasedMatch, )
where Self: Sized + Message,

Available on crate features GKBasePlayer and GKPlayer only.

Called when a player chooses to quit a match and that player has the current turn. The developer should call participantQuitInTurnWithOutcome:nextParticipants:turnTimeout:matchData:completionHandler: on the match passing in appropriate values. They can also update matchOutcome for other players as appropriate.

Source

unsafe fn player_didRequestMatchWithPlayers( &self, player: &GKPlayer, player_i_ds_to_invite: &NSArray<NSString>, )
where Self: Sized + Message,

👎Deprecated
Available on crate features GKBasePlayer and GKPlayer only.

Deprecated

Trait Implementations§

Source§

impl ProtocolType for dyn GKTurnBasedEventListener

Source§

const NAME: &'static str = "GKTurnBasedEventListener"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn GKTurnBasedEventListener

Implementations on Foreign Types§

Source§

impl<T> GKTurnBasedEventListener for ProtocolObject<T>

Implementors§