Package apple.gamekit

Class GKTurnBasedMatch

  • All Implemented Interfaces:
    NSObject

    public class GKTurnBasedMatch
    extends NSObject
    • Constructor Detail

      • GKTurnBasedMatch

        protected GKTurnBasedMatch​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • findMatchForRequestWithCompletionHandler

        public static void findMatchForRequestWithCompletionHandler​(GKMatchRequest request,
                                                                    GKTurnBasedMatch.Block_findMatchForRequestWithCompletionHandler completionHandler)
        Attempt to find a turn-based match for the specified request. Error will be nil on success. Possible reasons for error: 1. Communications failure 2. Unauthenticated player
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • loadMatchesWithCompletionHandler

        public static void loadMatchesWithCompletionHandler​(GKTurnBasedMatch.Block_loadMatchesWithCompletionHandler completionHandler)
        This method retrieves the list of GKTurnBasedMatches that the current player is or has participated in. The callback’s array contains GKTurnBasedMatches
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • activeExchanges

        public NSArray<? extends GKTurnBasedExchange> activeExchanges()
        returns the exchanges that currently await a reply from the local player
      • completedExchanges

        public NSArray<? extends GKTurnBasedExchange> completedExchanges()
        returns the exchanges that have been completed and need to be merged by the local participant. This will be nil unless the local participant is the current turn holder for this match
      • creationDate

        public NSDate creationDate()
      • currentParticipant

        public GKTurnBasedParticipant currentParticipant()
        This indicates the participant who has the current turn. This is set by passing the next participant into endTurnWithNextParticipant:matchData:completionHandler:
      • endMatchInTurnWithMatchDataCompletionHandler

        public void endMatchInTurnWithMatchDataCompletionHandler​(NSData matchData,
                                                                 GKTurnBasedMatch.Block_endMatchInTurnWithMatchDataCompletionHandler completionHandler)
        This will end the match for all participants. You must set each participant’s matchOutcome before calling this method. All completed exchanges must be resolved or canceled before calling this.
      • endMatchInTurnWithMatchDataScoresAchievementsCompletionHandler

        public void endMatchInTurnWithMatchDataScoresAchievementsCompletionHandler​(NSData matchData,
                                                                                   NSArray<? extends GKScore> scores,
                                                                                   NSArray<? extends GKAchievement> achievements,
                                                                                   GKTurnBasedMatch.Block_endMatchInTurnWithMatchDataScoresAchievementsCompletionHandler completionHandler)
        This will end the match and submit scores and achievements for all participants. Scores should be submitted for all involved players, and multiple scores may be submitted for each to different leaderboards. Earned achievements may also be submitted for any participants. You must set each participant’s matchOutcome before calling this method. All completed exchanges must be resolved or canceled before calling this.
      • endTurnWithNextParticipantsTurnTimeoutMatchDataCompletionHandler

        public void endTurnWithNextParticipantsTurnTimeoutMatchDataCompletionHandler​(NSArray<? extends GKTurnBasedParticipant> nextParticipants,
                                                                                     double timeout,
                                                                                     NSData matchData,
                                                                                     GKTurnBasedMatch.Block_endTurnWithNextParticipantsTurnTimeoutMatchDataCompletionHandler completionHandler)
        Ends the current player's turn. You may update the matchOutcome for any GKTurnBasedPlayerInfos that you wish to before ending the turn. This will asynchronously report error in these cases: 1. Communications problem 2. Is not current player's turn 3. Session is closed
      • exchangeDataMaximumSize

        public long exchangeDataMaximumSize()
        maximum data allowed for exchange data
      • exchangeMaxInitiatedExchangesPerPlayer

        public long exchangeMaxInitiatedExchangesPerPlayer()
        limit of the number of exchanges that this player can have initiated at a given time
      • exchanges

        public NSArray<? extends GKTurnBasedExchange> exchanges()
        exchanges that are in progress on this match. Once an exchange has completed and has been resolved by merging it into the match data by the current turn holder then it will be removed from this list
      • loadMatchDataWithCompletionHandler

        public void loadMatchDataWithCompletionHandler​(GKTurnBasedMatch.Block_loadMatchDataWithCompletionHandler completionHandler)
        This method fetches the match data and exchanges for this match. This data is the state of the game at this point in time. This may update the status and/or participant properties if they have changed.
      • matchData

        public NSData matchData()
        Developer-defined data representing the current state of the game. This property is nil until loaded by loadMatchDataWithCompletionHandler: The developer can submit updated matchData by passing it into endTurnWithNextParticipant:matchData:completionHandler: or endMatchInTurnWithMatchData:completionHandler:
      • matchDataMaximumSize

        public long matchDataMaximumSize()
        Returns the maximum size for the match data.
      • matchID

        public java.lang.String matchID()
      • message

        public java.lang.String message()
        returns the localizable message in the current locale. Setting this is equivalent to calling [self setLocalizableMessageWithKey:message arguments:nil]
      • rematchWithCompletionHandler

        public void rematchWithCompletionHandler​(GKTurnBasedMatch.Block_rematchWithCompletionHandler completionHandler)
        Recreate a previously existing turn based match that ended. A new match with the same set of players will be returned by the completion handler. If multiple players do this then multiple new matches will be created. Error will be nil on success. Possible reasons for error: 1. Communications failure 2. Unauthenticated player
      • removeWithCompletionHandler

        public void removeWithCompletionHandler​(GKTurnBasedMatch.Block_removeWithCompletionHandler completionHandler)
        Remove a declined or completed match (one with a matchOutcome set) from the player's list of matches. If using the GKTurnBasedMatchmakerViewController UI, this will remove it from the finished sessions. The developer should not do this without user input.
      • saveCurrentTurnWithMatchDataCompletionHandler

        public void saveCurrentTurnWithMatchDataCompletionHandler​(NSData matchData,
                                                                  GKTurnBasedMatch.Block_saveCurrentTurnWithMatchDataCompletionHandler completionHandler)
        saves the matchData for the current turn without ending the turn. If other players have the game running they will receive a handleTurnEventForMatch to indicate that the matchData has changed. This is useful to initialize the game state for the first player when they take their turn or for updating the turn data due to the user taking an irreversible action within their turn. All completed exchanges must be resolved or canceled before calling this. If you are using exchanges use saveMergedMatchData instead.
      • saveMergedMatchDataWithResolvedExchangesCompletionHandler

        public void saveMergedMatchDataWithResolvedExchangesCompletionHandler​(NSData matchData,
                                                                              NSArray<? extends GKTurnBasedExchange> exchanges,
                                                                              GKTurnBasedMatch.Block_saveMergedMatchDataWithResolvedExchangesCompletionHandler completionHandler)
        saves the merged matchData for the current turn without ending the turn and mark the supplied exchanges as resolved meaning that the data has been merged into the match data. If other players have the game running they will receive a handleTurnEventForMatch to indicate that the matchData has changed. It is required that all completed exchanges are resolved before ending a turn. Otherwise calling endTurn, participantQuitInTurnWithOutCome or endMatchInTurn will return an error
      • sendExchangeToParticipantsDataLocalizableMessageKeyArgumentsTimeoutCompletionHandler

        public void sendExchangeToParticipantsDataLocalizableMessageKeyArgumentsTimeoutCompletionHandler​(NSArray<? extends GKTurnBasedParticipant> participants,
                                                                                                         NSData data,
                                                                                                         java.lang.String key,
                                                                                                         NSArray<java.lang.String> arguments,
                                                                                                         double timeout,
                                                                                                         GKTurnBasedMatch.Block_sendExchangeToParticipantsDataLocalizableMessageKeyArgumentsTimeoutCompletionHandler completionHandler)
        Send an exchange request to one or more participants. Each recipient will receive a push notification using supplied localizable message. If any of the participants have an inactive status (GKTurnBasedParticipantStatusDone) then this will return an error.  completionHandler gets passed the updated exchange with identifier, sender and recipients set
      • sendReminderToParticipantsLocalizableMessageKeyArgumentsCompletionHandler

        public void sendReminderToParticipantsLocalizableMessageKeyArgumentsCompletionHandler​(NSArray<? extends GKTurnBasedParticipant> participants,
                                                                                              java.lang.String key,
                                                                                              NSArray<java.lang.String> arguments,
                                                                                              GKTurnBasedMatch.Block_sendReminderToParticipantsLocalizableMessageKeyArgumentsCompletionHandler completionHandler)
        Send a reminder to one or more participants. Each recipient will receive a push notification using supplied localizable message. This allows a game to send reminders that a turn or exchange request needs action. On the receiver side this will generate a turn event for the match.
      • setLocalizableMessageWithKeyArguments

        public void setLocalizableMessageWithKeyArguments​(java.lang.String key,
                                                          NSArray<java.lang.String> arguments)
        If the developer wishes to display a message in GKTurnBasedMatchmakerViewController at the end of a turn or end of the match. Only the current participant can set this. Sets a localizable mesage that will be localized on the receiver side if the game is installed and on the sender side as a fallback. The key and arguments offer a subset of formated strings as follows key is a string in a Localizable.strings file for the current localization (which is set by the user’s language preference). key string can be formatted with %@ and %n$@ specifiers to take the variables specified in loc-args arguments is an array of strings that will be substituted using the format string. Notes: The localized message will be evaluated locally from these keys and sent across as well so that devices that do not have the game installed will see the message in the sender's localization The developer can access resulting string using the message property This is a similar concept to the way we handle localization for Push Notifications. See the "Local and Push Notification Programming Guide" for more details.
      • setMessage

        public void setMessage​(java.lang.String value)
        returns the localizable message in the current locale. Setting this is equivalent to calling [self setLocalizableMessageWithKey:message arguments:nil]
      • status

        public long status()