コード例 #1
0
 void updateGameResult()
 {
     if (Result == TTTGameResult.InProgress)
     {
         Result = calculateGameResult();
     }
 }
コード例 #2
0
        public int NumberOfGamesWithResult(TTTGameResult result)
        {
            int count = 0;

            foreach (var game in Games)
            {
                if (game.Result == result)
                {
                    count++;
                }
            }

            return(count);
        }
コード例 #3
0
        public override void WillDisplay(UITableView tableView, UITableViewCell cell, NSIndexPath indexPath)
        {
            TTTGame game = Profile.Games [indexPath.Row];

            cell.TextLabel.Text = game.Date.ToString();
            TTTGameResult result = game.Result;

            if (result == TTTGameResult.Victory)
            {
                cell.DetailTextLabel.Text = "Victory";
            }
            else if (result == TTTGameResult.Defeat)
            {
                cell.DetailTextLabel.Text = "Defeat";
            }
            else if (result == TTTGameResult.Draw)
            {
                cell.DetailTextLabel.Text = "Draw";
            }
            else
            {
                cell.DetailTextLabel.Text = "In Progress";
            }
        }
コード例 #4
0
ファイル: TTTGame.cs プロジェクト: CBrauer/monotouch-samples
		void updateGameResult ()
		{
			if (Result == TTTGameResult.InProgress)
				Result = calculateGameResult ();
		}
コード例 #5
0
		public int NumberOfGamesWithResult (TTTGameResult result)
		{
			int count = 0;
			foreach (var game in Games) {
				if (game.Result == result)
					count++;
			}

			return count;
		}