/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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()); }