예제 #1
0
        public static List <RoboFanEntity> Generate(int num = 1, bool generateImage = true, bool generateRankings = true)
        {
            // generate teams and fans
            var listteams = LeagueTeamGenerator.Generate();
            List <RoboFanEntity> listitems = GenerateFans(num, listteams);

            // loop through all the generated items
            foreach (var fan in listitems)
            {
                // update the fanid and generate child entities if specified
                fan.RoboFanImage = RoboFanImageGenerator.Generate(fan.Id, generateImage);
                if (generateRankings)
                {
                    fan.FanRankings = RoboFanTeamRankingsGenerator.GenerateTeamRankings(fan, listteams);
                }
            }

            return(listitems);
        }
예제 #2
0
        public static async Task <List <RoboFanEntity> > GenerateAsync(int num, string imagepath, bool generateRankings = true)
        {
            // generate teams and fans
            var listteams = LeagueTeamGenerator.Generate();
            List <RoboFanEntity> listitems = GenerateFans(num, listteams);

            // loop through all the generated items
            foreach (var fan in listitems)
            {
                // update the fanid and generate child entities if specified
                fan.RoboFanImage = await RoboFanImageGenerator.GenerateAsync(fan.Id, imagepath);

                if (generateRankings)
                {
                    fan.FanRankings = RoboFanTeamRankingsGenerator.GenerateTeamRankings(fan, listteams);
                }
            }

            return(listitems);
        }