Example #1
0
        private static void PushWinner(string tournamentName, string winner)
        {
            if (TournamentRepository.GetTournament(tournamentName) == null)
            {
                Console.WriteLine("This tournament is not created");
                return;
            }

            var tournament = TournamentRepository.GetTournament(tournamentName);
            var newRoster  = TournamentManager.PushWinner(tournament, winner);

            TournamentRepository.SaveTournament(tournament);
        }
Example #2
0
        private static void StartTournament(string tournamentName, string csvParticipants)
        {
            var participants = csvParticipants.Split(',');

            if (TournamentRepository.GetTournament(tournamentName) != null)
            {
                Console.WriteLine("This tournament is already created");
                return;
            }

            var roster     = TournamentManager.CreateRoster(participants);
            var tournament = new string[][] { roster };

            TournamentRepository.SaveTournament(tournament);
        }