private void LoadPlayers(GKPlayer[] players, NSError error)
        {
            foreach (GKPlayer player in players)
              {
            player.LoadPhoto(GKPhotoSize.Normal, (image, loadImageError) => {

              _playerImageCache.Add(player.PlayerID, image);

              BeginInvokeOnMainThread(() => {
            // TODO Refresh images
              });
            });
              }
        }
Пример #2
0
        public override void DidRequestMatchWithPlayers(GKPlayer player, object[] playerIDsToInvite)
        {
            // send it to both realtime and turn-based if they are init'd
            if (RealTimeMatchesController._init)
                RealTimeMatchesController._MatchInviteHandler(null, playerIDsToInvite);

            if (TurnBasedMatchesController._init) {
                Player.LoadPlayersByIDs(playerIDsToInvite.Cast<string>().ToArray(), delegate(Player[] players) {
                    if (players.Length > 0) {
                        TurnBasedMatchesController._OnInvitePlayers(players);
                    }
                });
            }
        }
Пример #3
0
        /// <summary>
        /// Gets (and download and cache if necessary) the profile image for a player
        /// </summary>
        /// <param name="playerId">Player identifier.</param>
        /// <param name="callback">Callback.</param>
        public static void GetProfileImage(GKPlayer player, Action<UIImage> callback)
        {
            Logger.I ("Loading player picture..." + player.PlayerID);

            // Ask Game center
            player.LoadPhoto (GKPhotoSize.Normal, (photo, error) => {
                if (error == null) {
                    if (callback != null) {
                        callback (photo);
                    }
                } else {
                    Logger.E ("GameCenterHelper.GetProfileImage", error);
                }
            });
        }
Пример #4
0
 public virtual void PlayerDidChangeConnectionState(GKMatch match, GKPlayer player, GKMatch.GKPlayerConnectionState state)
 {
 }
Пример #5
0
		void DisplayScore (GKScore score, int rank, GKPlayer player)
		{
			PointF[] podiumPositions = new PointF[] {
				new PointF (0, 100),
				new PointF (-84, 75),
				new PointF (84, 50)
			};

			PointF currentPoint = podiumPositions [rank];

			SKLabelNode scoreLabel = new SKLabelNode ("GillSans-Bold") {
				Text = score.FormattedValue,
				FontSize = 14,
				Position = new PointF (FrameMidX + currentPoint.X, FrameMidY + currentPoint.Y - 32)
			};

			player.LoadPhoto (GKPhotoSize.Small, delegate (UIImage photo, NSError error) {
				if (photo == null)
					photo = UIImage.FromFile ("Images/DefaultPlayerPhoto.png");
				var image = SKSpriteNode.FromTexture (SKTexture.FromImage (photo), new SizeF (32, 32));
				image.Position = new PointF (FrameMidX + currentPoint.X, FrameMidY + currentPoint.Y + 16);
				AddChild (image);
			});

			AddChild (scoreLabel);
		}
Пример #6
0
 public virtual void PlayerDidAcceptInvite(GKPlayer player, GKInvite invite)
 {
 }
Пример #7
0
 public override void ReceivedExchangeRequest(GKPlayer player, GKTurnBasedExchange exchange, GKTurnBasedMatch match)
 {
     TurnBasedMatchesController._OnExchangeRequest(match, exchange);
 }
Пример #8
0
 public override void DidAccept(GKPlayer player, GKInvite invite)
 {
     RealTimeMatchesController._MatchInviteHandler(invite, null);
 }
Пример #9
0
 public override void DidReceive(GKPlayer player, GKChallenge challenge)
 {
 }
Пример #10
0
 public override void DidAccept(GKPlayer player, GKInvite invite)
 {
     RealTimeMatchesController._MatchInviteHandler(invite, null);
 }
Пример #11
0
 public virtual void MatchmakerViewControllerHostedPlayerDidAccept(GKMatchmakerViewController viewController, GKPlayer player)
 {
 }
Пример #12
0
 public virtual void PlayerReceivedTurnEventForMatch(GKPlayer player, GKTurnBasedMatch match, bool didBecomeActive)
 {
 }
Пример #13
0
 public virtual void PlayerWantsToQuitMatch(GKPlayer player, GKTurnBasedMatch match)
 {
 }
Пример #14
0
 public virtual void PlayerMatchEnded(GKPlayer player, GKTurnBasedMatch match)
 {
 }
Пример #15
0
 public virtual void PlayerDidRequestMatchWithOtherPlayers(GKPlayer player, GKPlayer[] playersToInvite)
 {
 }
Пример #16
0
 public virtual void PlayerDidRequestMatchWithRecipients(GKPlayer player, GKPlayer[] recipientPlayers)
 {
 }
Пример #17
0
 public virtual void MatchDidReceiveData(GKMatch match, NSData data, GKPlayer remotePlayer)
 {
 }
Пример #18
0
 public override void Ended(GKPlayer player, GKTurnBasedMatch match)
 {
     TurnBasedMatchesController._OnMatchEnded(match);
 }
Пример #19
0
 public override void IssuedChallengeWasCompleted(GKPlayer player, GKChallenge challenge, GKPlayer friendPlayer)
 {
 }
Пример #20
0
 public override void ReceivedTurnEvent(GKPlayer player, GKTurnBasedMatch match, bool didBecomeActive)
 {
     TurnBasedMatchesController._OnTurnEvent(match, didBecomeActive);
 }
Пример #21
0
 public override void WantsToPlay(GKPlayer player, GKChallenge challenge)
 {
 }
Пример #22
0
 public override void Ended(GKPlayer player, GKTurnBasedMatch match)
 {
     TurnBasedMatchesController._OnMatchEnded(match);
 }
Пример #23
0
 public override void DidComplete(GKPlayer player, GKChallenge challenge, GKPlayer friendPlayer)
 {
 }
Пример #24
0
 public override void ReceivedExchangeCancellation(GKPlayer player, GKTurnBasedExchange exchange, GKTurnBasedMatch match)
 {
     TurnBasedMatchesController._OnExchangeCancellation(match, exchange);
 }
Пример #25
0
 public override void ReceivedExchangeCancellation(GKPlayer player, GKTurnBasedExchange exchange, GKTurnBasedMatch match)
 {
     TurnBasedMatchesController._OnExchangeCancellation(match, exchange);
 }
Пример #26
0
 // Must be implemented.
 public abstract bool ShouldReinviteDisconnectedPlayer(GKMatch match, GKPlayer player);
Пример #27
0
 public override void IssuedChallengeWasCompleted(GKPlayer player, GKChallenge challenge, GKPlayer friendPlayer)
 {
 }
Пример #28
0
 public override void ReceivedExchangeReplies(GKPlayer player, object[] replies, GKTurnBasedExchange exchange, GKTurnBasedMatch match)
 {
     TurnBasedMatchesController._OnExchangeCompleted(match, exchange, replies);
 }
Пример #29
0
 public override void ReceivedExchangeReplies(GKPlayer player, object[] replies, GKTurnBasedExchange exchange, GKTurnBasedMatch match)
 {
     TurnBasedMatchesController._OnExchangeCompleted(match, exchange, replies);
 }
Пример #30
0
 public override void ReceivedExchangeRequest(GKPlayer player, GKTurnBasedExchange exchange, GKTurnBasedMatch match)
 {
     TurnBasedMatchesController._OnExchangeRequest(match, exchange);
 }
Пример #31
0
 public override void ReceivedTurnEvent(GKPlayer player, GKTurnBasedMatch match, bool didBecomeActive)
 {
     TurnBasedMatchesController._OnTurnEvent(match, didBecomeActive);
 }
Пример #32
0
 public override void DidReceive(GKPlayer player, GKChallenge challenge)
 {
 }
		public override void DidReceiveChallenge (GKPlayer player, GKChallenge challenge)
		{
			var action = DidReceiveChallengeAction;
			if (action != null)
				action (player, challenge);
		}
Пример #34
0
 public override void WantsToPlay(GKPlayer player, GKChallenge challenge)
 {
 }
Пример #35
0
 public override void DidComplete(GKPlayer player, GKChallenge challenge, GKPlayer friendPlayer)
 {
 }
Пример #36
0
 public virtual void MatchDidReceiveDataForRecipient(GKMatch match, NSData data, GKPlayer recipient, GKPlayer remotePlayer)
 {
 }