コード例 #1
0
        /// <summary>
        /// Programmatically searches for a new match to join.
        /// </summary>
        /// <param name="request">Request.</param>
        /// <param name="completionHandler">Completion handler.</param>
        public static void FindMatchForRequest(GKMatchRequest request, Action <GKTurnBasedMatch, NSError> completionHandler)
        {
            Util.NullArgumentTest(request);

            C.GKTurnBasedMatch_findMatchForRequest(
                request.ToPointer(),
                InternalSingleMatchCallback,
                PInvokeCallbackUtil.ToIntPtr(completionHandler));
        }
コード例 #2
0
ファイル: GKMatchmaker.cs プロジェクト: artemy0/Quiz
        /// <summary>
        /// Initiates a request to find players for a hosted match.
        /// </summary>
        /// <param name="request">Request.</param>
        /// <param name="completionHandler">Completion handler.</param>
        public void FindPlayersForHostedRequest(GKMatchRequest request, Action <NSArray <GKPlayer>, NSError> completionHandler)
        {
            Util.NullArgumentTest(request);

            C.GKMatchmaker_findPlayersForHostedRequest(
                SelfPtr(),
                request.ToPointer(),
                PlayersErrorCallback,
                PInvokeCallbackUtil.ToIntPtr(completionHandler));
        }
コード例 #3
0
ファイル: GKMatchmaker.cs プロジェクト: artemy0/Quiz
        /// <summary>
        /// Initiates a request to find players for a peer-to-peer match.
        /// </summary>
        /// <param name="request">Request.</param>
        /// <param name="completionHandler">Completion handler.</param>
        public void FindMatchForRequest(GKMatchRequest request, Action <GKMatch, NSError> completionHandler)
        {
            Util.NullArgumentTest(request);

            C.GKMatchmaker_findMatchForRequest(
                SelfPtr(),
                request.ToPointer(),
                MatchErrorCallback,
                PInvokeCallbackUtil.ToIntPtr(completionHandler));
        }
コード例 #4
0
ファイル: GKMatchmaker.cs プロジェクト: artemy0/Quiz
        /// <summary>
        /// Adds players to an existing match.
        /// </summary>
        /// <param name="match">Match.</param>
        /// <param name="matchRequest">Match request.</param>
        /// <param name="completionHandler">Completion handler.</param>
        public void AddPlayersToMatch(GKMatch match, GKMatchRequest matchRequest, Action <NSError> completionHandler)
        {
            Util.NullArgumentTest(match);
            Util.NullArgumentTest(matchRequest);

            C.GKMatchmaker_addPlayersToMatch(
                SelfPtr(),
                match.ToPointer(),
                matchRequest.ToPointer(),
                ErrorCallback,
                PInvokeCallbackUtil.ToIntPtr(completionHandler));
        }
コード例 #5
0
 /// <summary>
 /// Initializes a matchmaker view controller to create a new match.
 /// </summary>
 /// <param name="request">Request.</param>
 public GKMatchmakerViewController(GKMatchRequest request)
     : this(C.GKMatchmakerViewController_initWithMatchRequest(request != null ? request.ToPointer() : IntPtr.Zero))
 {
     // We're using a pointer returned by a native constructor: must call CFRelease().
     CoreFoundation.CFType.CFRelease(this.ToPointer());
 }