Package apple.gamekit.protocol
Interface GKTurnBasedEventListener
-
- All Known Subinterfaces:
GKLocalPlayerListener
public interface GKTurnBasedEventListener
-
-
Method Summary
All Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default voidplayerDidRequestMatchWithOtherPlayers(GKPlayer player, NSArray<? extends GKPlayer> playersToInvite)If Game Center initiates a match the developer should create a GKTurnBasedMatch from playersToInvite and present a GKTurnbasedMatchmakerViewController.default voidplayerDidRequestMatchWithPlayers(GKPlayer player, NSArray<java.lang.String> playerIDsToInvite)Deprecated.default voidplayerMatchEnded(GKPlayer player, GKTurnBasedMatch match)called when the match has ended.default voidplayerReceivedExchangeCancellationForMatch(GKPlayer player, GKTurnBasedExchange exchange, GKTurnBasedMatch match)this is called when an exchange is canceled by the sender.default voidplayerReceivedExchangeRepliesForCompletedExchangeForMatch(GKPlayer player, NSArray<? extends GKTurnBasedExchangeReply> replies, GKTurnBasedExchange exchange, GKTurnBasedMatch match)called when all players either respond or timeout responding to this request.default voidplayerReceivedExchangeRequestForMatch(GKPlayer player, GKTurnBasedExchange exchange, GKTurnBasedMatch match)this is called when a player receives an exchange request from another player.default voidplayerReceivedTurnEventForMatchDidBecomeActive(GKPlayer player, GKTurnBasedMatch match, boolean didBecomeActive)called when it becomes this player's turn.default voidplayerWantsToQuitMatch(GKPlayer player, GKTurnBasedMatch match)Called when a player chooses to quit a match and that player has the current turn.
-
-
-
Method Detail
-
playerDidRequestMatchWithOtherPlayers
default void playerDidRequestMatchWithOtherPlayers(GKPlayer player, NSArray<? extends GKPlayer> playersToInvite)
If Game Center initiates a match the developer should create a GKTurnBasedMatch from playersToInvite and present a GKTurnbasedMatchmakerViewController.
-
playerDidRequestMatchWithPlayers
@Deprecated default void playerDidRequestMatchWithPlayers(GKPlayer player, NSArray<java.lang.String> playerIDsToInvite)
Deprecated.Deprecated
-
playerMatchEnded
default void playerMatchEnded(GKPlayer player, GKTurnBasedMatch match)
called when the match has ended.
-
playerReceivedExchangeCancellationForMatch
default void playerReceivedExchangeCancellationForMatch(GKPlayer player, GKTurnBasedExchange exchange, GKTurnBasedMatch match)
this is called when an exchange is canceled by the sender.
-
playerReceivedExchangeRepliesForCompletedExchangeForMatch
default void playerReceivedExchangeRepliesForCompletedExchangeForMatch(GKPlayer player, NSArray<? extends GKTurnBasedExchangeReply> replies, GKTurnBasedExchange exchange, GKTurnBasedMatch match)
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
-
playerReceivedExchangeRequestForMatch
default void playerReceivedExchangeRequestForMatch(GKPlayer player, GKTurnBasedExchange exchange, GKTurnBasedMatch match)
this is called when a player receives an exchange request from another player.
-
playerReceivedTurnEventForMatchDidBecomeActive
default void playerReceivedTurnEventForMatchDidBecomeActive(GKPlayer player, GKTurnBasedMatch match, boolean didBecomeActive)
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.
-
playerWantsToQuitMatch
default void playerWantsToQuitMatch(GKPlayer player, GKTurnBasedMatch match)
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.
-
-