private async void button1_Click(object sender, EventArgs e)
        {
            int tournamentUID = 1;
            PendingTournament pendingTournament = await new TournamentCreator(caller).create("Tournament" + tournamentUID, TournamentType.Double_Elimination, "SSBMCPUTOURNAMENT" + tournamentUID);

            foreach (Player player in players.players)
            {
                await pendingTournament.AddParticipant(player.name);
            }
            ;
            StartedTournament tournament = await pendingTournament.StartTournament();

            await nextMatch(tournament);
        }
Exemplo n.º 2
0
        private async void button1_Click(object sender, EventArgs e)
        {
            Button me = (Button)sender;

            me.Hide();
            TournamentCreator creator    = new TournamentCreator(caller);
            PendingTournament tournament = await creator.create("TestingCreator", TournamentType.Double_Elimination, "ssbmCPU_1");

            await tournament.AddParticipant("CPU44");

            await tournament.AddParticipant("CPU22");

            StartedTournament started = await tournament.StartTournament();

            Console.WriteLine(await started.remainingUncompletedMatches);
            me.Show();
        }
        private async Task <ClosedMatch> nextMatch(StartedTournament tournament)
        {
            OpenMatch currentMatch = await tournament.getNextMatch();

            string player1Name = (await currentMatch.player1).name;
            string player2Name = (await currentMatch.player2).name;

            FinishedDuelMatch duel = await meleeMenu
                                     .setPlayerOnPort(players.Get(new PlayerID(player1Name)).meleePlayer, 1)
                                     .setPlayerOnPort(players.Get(new PlayerID(player2Name)).meleePlayer, 2)
                                     .setRandomStage()
                                     .confirm();

            if (duel.winner.name == player1Name)
            {
                currentMatch.addScore(new Score(1, 0));
            }
            else
            {
                currentMatch.addScore(new Score(0, 1));
            }
            return(await currentMatch.close());
        }
        private async void startedTournamentsListBox_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            StartedTournament tournament = startedTournamentsListBox.SelectedItem as StartedTournament;

            await nextMatch(tournament);
        }