HandsOff/MatchMakerPage.xaml.cs
/// <summary>
/// Creates new Match using the two selected teams.
/// </summary>
Creates new Match using the two selected teams.
Creates new Match using the two selected teams .
public async void MakeMatch()
        {
            int AmountOfMatches = (int)long.Parse(NumberOfMatches.Text);
            if (AmountOfMatches > 100)
            {
                MessageDialog showDialog = new MessageDialog("Kies een getal onder de 100");
                showDialog.Commands.Add(new UICommand("Ok")
                {
                    Id = 0
                });
                showDialog.DefaultCommandIndex = 0;
                IUICommand result = await showDialog.ShowAsync();
                if ((int)result.Id == 0)
                {
                    return;
                }
            }
            while (AmountOfMatches > 0)
            {
                Match match = new Match(SelectedTeam1, SelectedTeam2);
                Matches.Add(match);
                AmountOfMatches--;
            }
            Frame.Navigate(typeof(SimulationExecution), Matches);
        }
public async void MakeMatch ( ) { int AmountOfMatches = ( int ) long . Parse ( NumberOfMatches . Text ) ; if ( AmountOfMatches > 100 ) { MessageDialog showDialog = new MessageDialog ( " " ) ; showDialog . Commands . Add ( new UICommand ( " " ) { Id = 0 } ) ; showDialog . DefaultCommandIndex = 0 ; IUICommand result = await showDialog . ShowAsync ( ) ; if ( ( int ) result . Id == 0 ) { return ; } } while ( AmountOfMatches > 0 ) { Match match = new Match ( SelectedTeam1 , SelectedTeam2 ) ; Matches . Add ( match ) ; AmountOfMatches -- ; } Frame . Navigate ( typeof ( SimulationExecution ) , Matches ) ; }
Creates new Match using the two selected teams.
Creates new Match using the two selected teams .
//Show dialog if only one or no teams are selected. // instantiates the amount of matches selected during matchmaking.