Esempio n. 1
0
        /// <summary>
        /// Loads all the turn-based matches involving the local player and calls the callback on completion.
        /// </summary>
        /// <param name="callback">Callback.</param>
        public static void LoadAllMyMatches(Action <TurnBasedMatch[], NSError> callback)
        {
            GKTurnBasedMatch.LoadMatches(delegate(object[] gkmatches, NSError error) {
                if ((gkmatches == null) || (gkmatches.Length == 0))
                {
                    callback(null, error);
                    callback = null;
                }
                else
                {
                    var matches     = new TurnBasedMatch[gkmatches.Length];
                    int totalLoaded = 0;
                    for (int i = 0; i < gkmatches.Length; i++)
                    {
                        var gkmatch = gkmatches[i] as GKTurnBasedMatch;
                        matches[i]  = NSObjectWrapper.CreateWrapper(typeof(TurnBasedMatch), gkmatch) as TurnBasedMatch;
                        gkmatch     = null;

                        matches[i].ReloadPlayers(delegate() {
                            totalLoaded++;
                            if (totalLoaded == matches.Length)
                            {
                                callback(matches, error);
                                callback = null;
                                matches  = null;
                                error    = null;
                            }
                        });
                    }
                }

                gkmatches = null;
            });
        }
Esempio n. 2
0
 /// <summary>
 /// U3DXT internal.
 /// </summary>
 /// <param name="match">Match.</param>
 internal static void _CheckSetCurrentMatch(TurnBasedMatch match)
 {
     if (match.isCurrentMatch)
     {
         _currentMatch = match;
     }
 }
 /// <summary>
 /// U3DXT internal.
 /// </summary>
 /// <param name="match">Match.</param>
 internal static void _CheckSetCurrentMatch(TurnBasedMatch match)
 {
     if (match.isCurrentMatch)
         _currentMatch = match;
 }
 /// <summary>
 /// Sets a TurnBasedMatch as the current match.
 /// </summary>
 /// <param name="match">The match to be set as the current match.</param>
 public static void SetCurrentMatch(TurnBasedMatch match)
 {
     _currentMatch = match;
 }
        /// <summary>
        /// Loads all the turn-based matches involving the local player and calls the callback on completion.
        /// </summary>
        /// <param name="callback">Callback.</param>
        public static void LoadAllMyMatches(Action<TurnBasedMatch[], NSError> callback)
        {
            GKTurnBasedMatch.LoadMatches(delegate(object[] gkmatches, NSError error) {
                if ((gkmatches == null) || (gkmatches.Length == 0)) {
                    callback(null, error);
                    callback = null;
                } else {
                    var matches = new TurnBasedMatch[gkmatches.Length];
                    int totalLoaded = 0;
                    for (int i=0; i<gkmatches.Length; i++) {
                        var gkmatch = gkmatches[i] as GKTurnBasedMatch;
                        matches[i] = NSObjectWrapper.CreateWrapper(typeof(TurnBasedMatch), gkmatch) as TurnBasedMatch;
                        gkmatch = null;

                        matches[i].ReloadPlayers(delegate() {
                            totalLoaded++;
                            if (totalLoaded == gkmatches.Length) {
                                callback(matches, error);
                                callback = null;
                                matches = null;
                                error = null;
                            }
                        });
                    }
                }

                gkmatches = null;
            });
        }
Esempio n. 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="U3DXT.iOS.GameKit.TurnChangedEventArgs"/> class.
 /// </summary>
 /// <param name="match">Match.</param>
 public TurnChangedEventArgs(TurnBasedMatch match)
     : base(match)
 {
     isLocalPlayersTurn = match.isLocalPlayerTurn;
 }
Esempio n. 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="U3DXT.iOS.GameKit.TurnChangedEventArgs"/> class.
 /// </summary>
 /// <param name="match">Match.</param>
 public TurnChangedEventArgs(TurnBasedMatch match) : base(match)
 {
     isLocalPlayersTurn = match.isLocalPlayerTurn;
 }
Esempio n. 8
0
 /// <summary>
 /// Sets a TurnBasedMatch as the current match.
 /// </summary>
 /// <param name="match">The match to be set as the current match.</param>
 public static void SetCurrentMatch(TurnBasedMatch match)
 {
     _currentMatch = match;
 }