コード例 #1
0
        public void Run()
        {
            ArgumentHandler arguments = ArgumentHandler.GetInstance();
            Randomizer      rnd       = Randomizer.GetInstance();

            #region Generiranje tema
            int maxNumberOfThemes = (int)arguments.GetArgument("MaxThemeNumber");
            int numberOfThemes    = rnd.GetNumber(1, maxNumberOfThemes);
            Console.WriteLine("\nBroj tema: " + numberOfThemes);

            List <Theme> listOfThemes = new List <Theme>();
            listOfThemes = GenerateThemes(numberOfThemes);
            Console.WriteLine("\nOdabrane teme:");
            foreach (Theme theme in listOfThemes)
            {
                Console.WriteLine(theme.Name);
            }
            #endregion

            #region Generiranje kategorija
            int numberOfCategories = rnd.GetNumber(1, 3);
            Console.WriteLine("\nBroj kategorija: " + numberOfCategories);

            List <string> listOfCategories = new List <string>();
            listOfCategories = GenerateCategories(numberOfCategories);
            Console.WriteLine("Odabrane kategorije:");
            foreach (string category in listOfCategories)
            {
                Console.WriteLine(category);
            }
            #endregion

            #region Generiranje natjecatelja
            int maxNumberOfCompetitors = (int)arguments.GetArgument("MaxCompetitorNumber");
            int numberOfCompetitors    = rnd.GetNumber(0, maxNumberOfCompetitors);
            Console.WriteLine("\nBroj natjecatelja: " + numberOfCompetitors);

            List <Competitor> listOfCompetitors = GenerateCompetitors(numberOfCompetitors);
            Console.WriteLine("\nNatjecatelji:");
            foreach (Competitor competitor in listOfCompetitors)
            {
                Console.WriteLine(competitor.Name);
            }
            #endregion

            #region Generiranje prijava
            int maxThemeNumberPerCompetitor         = (int)arguments.GetArgument("MaxThemeNumberPerCompetitor");
            int maxCategoryNumberPerCompetitor      = (int)arguments.GetArgument("MaxCategoryNumberPerCompetitor");
            List <Registration> listOfRegistrations = GenerateRegistrations(listOfCompetitors, maxThemeNumberPerCompetitor, maxCategoryNumberPerCompetitor, numberOfThemes, listOfThemes, numberOfCategories, listOfCategories);
            #endregion

            Competition competition = Competition.GetInstance();
            competition.UploadCompetitionData(listOfRegistrations, listOfThemes, listOfCategories, listOfCompetitors);
            Console.WriteLine("\nPrihvaćeno " + listOfRegistrations.Count.ToString() + " prijava");
        }
コード例 #2
0
        public void Run()
        {
            Console.WriteLine("\n\nZapočinje proces bodovanja");
            Competition         competition         = Competition.GetInstance();
            List <Registration> listOfRegistrations = competition.DownloadRegistrations();

            Disqualify(listOfRegistrations);
            List <Jury> jury = GenerateJury();

            GenerateScores(listOfRegistrations, jury);
            Dictionary <Registration, float> finalScores = new Dictionary <Registration, float>();

            GenerateFinalScores(listOfRegistrations, finalScores);
            VictoryProclamation(competition);
        }