Example #1
0
        private void Finals(List <Team> teams)
        {
            List <Team> FinalsWinners = RoundSimulator.Simulation(teams, 2, "final");

            CustomColor.CustomConsoleColor(ConsoleColor.Magenta);
            Console.WriteLine($"\t\t\t\t\t\tThe Winning team is the {FinalsWinners[0].Name.ToUpper()}");
            CustomColor.CustomConsoleColor(ConsoleColor.Gray);
        }
Example #2
0
        private void MatchUp(Team team1, Team team2)
        {
            Arena arena = new Arena(RandomGenerator.RandomArena(), RandomGenerator.RandomCapacity());

            Teams.Add(team1);
            Teams.Add(team2);
            CustomColor.CustomConsoleColor(ConsoleColor.Red);
            Console.WriteLine($"\n{team1.Name.ToUpper()} VS {team2.Name.ToUpper()}");
            CustomColor.CustomConsoleColor(ConsoleColor.Gray);
            Hold.Wait(1000);
        }
Example #3
0
        public static List <Team> Simulation(List <Team> teams, int roundparticipants, string round)
        {
            Console.WriteLine($"\n\t\t\t\t\t\t\t{round.ToUpper()} ROUND");
            List <Team> winners = new List <Team>();
            Team        winner;
            int         i = 0;

            while (i < roundparticipants)
            {
                Team        team1;
                Team        team2;
                List <Team> participants = new List <Team>();
                int         indexTeam1   = RandomGenerator.Next(teams.Count);
                team1 = teams[indexTeam1];
                teams.RemoveAt(indexTeam1);

                int indexTeam2 = RandomGenerator.Next(teams.Count);
                team2 = teams[indexTeam2];
                teams.RemoveAt(indexTeam2);

                participants.Add(team1);
                participants.Add(team2);

                GameSimulator game = new GameSimulator(team1, team2);
                winner = game.WinnerIs(participants);
                winners.Add(winner);

                i += 2;
            }

            CustomColor.CustomConsoleColor(ConsoleColor.Green);
            Console.WriteLine($"\nThe winners of the {round.ToUpper()} ROUNDS are:");
            CustomColor.CustomConsoleColor(ConsoleColor.Gray);

            Hold.Wait(1000);

            Console.ForegroundColor = ConsoleColor.Yellow;
            foreach (Team team in winners)
            {
                Console.WriteLine($"\n{team.Name.ToUpper()}\n");
                Hold.Wait(500);
            }
            CustomColor.CustomConsoleColor(ConsoleColor.Gray);
            return(winners);
        }