コード例 #1
0
        public List <TEntity> GenerateAssembly(ePerson personType, int countryRating, int?competitionRation = null, int?teamRating = null)
        {
            var totalRating = teamRating != null && competitionRation != null
                ? countryRating * (int)competitionRation * (int)teamRating
                : countryRating *RandomUtil.GetRandomInt(2, 5) * RandomUtil.GetRandomInt(2, 5);

            var assembly = BuildAssembly();

            CompleteAssembly(assembly);
            return(CreateAllPersonsInAssembly(assembly, totalRating, personType));
        }
コード例 #2
0
        protected internal static List <TEntity> CreateAllPersonsInAssembly(Dictionary <int, int> assembly, int totalRating, ePerson personType)
        {
            var persons = new List <TEntity>();

            foreach (var person in assembly)
            {
                for (int i = 0; i < person.Value; i++)
                {
                    persons.Add(PersonStrategyFactory <TEntity> .CreatePerson(personType, totalRating, person.Key));
                }
            }

            return(persons);
        }
コード例 #3
0
 public static List <TEntity> GenerateAssembly(ePerson personType, int countryRating,
                                               int?competitionRation = null, int?teamRating = null)
 {
     return(((IAssemblyGenerator <TEntity>)AssemblyDictionary[personType]).GenerateAssembly(personType, countryRating, competitionRation, teamRating));
 }
コード例 #4
0
 public static void SetPersonAttributes(ePerson personType, TEntity person)
 {
     ((IPersonGeneratorStrategy <TEntity>)PersonDictionary[personType]).SetPersonAttributes(person);
 }
コード例 #5
0
 public static void SetPersonalInformation(ePerson personType, TEntity person)
 {
     ((IPersonGeneratorStrategy <TEntity>)PersonDictionary[personType]).SetPersonalInformation(person);
 }
コード例 #6
0
 public static TEntity CreatePerson(ePerson personType, int totalRating, int mainFunction)
 {
     return(((IPersonGeneratorStrategy <TEntity>)PersonDictionary[personType]).CreatePerson(totalRating, mainFunction));
 }