void updateGameResult() { if (Result == TTTGameResult.InProgress) { Result = calculateGameResult(); } }
public int NumberOfGamesWithResult(TTTGameResult result) { int count = 0; foreach (var game in Games) { if (game.Result == result) { count++; } } return(count); }
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"; } }
void updateGameResult () { if (Result == TTTGameResult.InProgress) Result = calculateGameResult (); }
public int NumberOfGamesWithResult (TTTGameResult result) { int count = 0; foreach (var game in Games) { if (game.Result == result) count++; } return count; }