示例#1
0
        private MatchResult GetMatchResult(bool didUserWin)
        {
            var matchResult = new MatchResult ();

            if (didUserWin)
                matchResult.Result = ResultType.Victory;
            else
                matchResult.Result = ResultType.Defeat;

            return matchResult;
        }
		private async void HandleMatchResult (MatchResult result)
		{
			switch (result.Result) {
			case ResultType.Victory:
				DisplayTiming (result.TapTiming);
				UpdateScore (result.TapTiming);
				break;
			case ResultType.Draw:
			case ResultType.Defeat:
			case ResultType.WrongTiming:					
				PauseWhileShowingScores ();
				loadingOn = true;				
				await PublishScore ();			
				await ShowLeaderboard ();
				ShowFullAd ();
				RefreshAd ();
				loadingOn = false;
				break;
			default:
				throw new ArgumentException (string.Format ("Unrecognized MatchResult type: {0}", result.Result));
			}
		}
 private void HandleMatchResult(MatchResult result)
 {
     switch (result) {
     case MatchResult.Victory:
         HandScreen.ChangeCollisionAreaColor (Color.Green);
         break;
     case MatchResult.Draw:
         HandScreen.ChangeCollisionAreaColor (Color.Yellow);
         break;
     case MatchResult.Defeat:
         HandScreen.ChangeCollisionAreaColor (Color.Red);
         break;
     case MatchResult.WrongTiming:
         HandScreen.ChangeCollisionAreaColor (Color.Blue);
         break;
     default:
         throw new ArgumentException ("Unrecognized MatchResult type");
         break;
     }
 }