Example #1
0
 private static void GenerateScoreViewModels(
     Random random,
     int goals,
     int goalsConceded,
     List <ScoreViewModel> models)
 {
     StatisticsGenerator.GenerateGoalStats(random, goals, models);
     foreach (var model in models)
     {
         StatisticsGenerator.GenerateShots(random, goals, model);
         StatisticsGenerator.GenerateTackles(random, goalsConceded, model);
         StatisticsGenerator.GenerateYellowCards(random, model);
         StatisticsGenerator.GenerateRedCards(random, model);
     }
 }
Example #2
0
        public static List <ScoreViewModel> GenerateTeamPlayerScores(
            int matchdayWeek,
            int goals,
            int goalsConceded,
            Team team)
        {
            var random = new Random();

            int subs  = random.Next(ScoreConstants.MaxSubs + 1);
            var squad = SquadGenerator.GenerateRandomSquad(random, matchdayWeek, team);

            var models = CreateScoreViewModels(random, matchdayWeek, squad, subs, team);

            GenerateScoreViewModels(random, goals, goalsConceded, models);
            models = StatisticsGenerator.GenerateSubstitutions(random, subs, models);

            return(models.Distinct().ToList());
        }