예제 #1
0
        private async void selectCharButton_Click(object sender, EventArgs e)
        {
            FinishedDuelMatch duel = await states.meleeMenu
                                     .setPlayerOnPort(new MeleePlayer(manager.getRandomCharacter(), "1"), 1)
                                     .setPlayerOnPort(new MeleePlayer(manager.getRandomCharacter(), "2"), 2)
                                     .setStage(Stage.DreamLand)
                                     .confirm();

            Console.WriteLine("Winner is : " + duel.winner);
        }
        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());
        }