예제 #1
0
        public Player Generate(Gender?playerGender = null, Country[] countries = null, PlayerPosition playerPosition = null)
        {
            if (playerGender == null)
            {
                playerGender = _genderGenerator.Generate();
            }

            if (countries == null)
            {
                countries = _countriesGenerator.Generate().Value;
            }

            PersonName playerName = _nameGenerator.Generate(playerGender.Value, countries.FirstOrDefault());
            Date       dob        = _dobGenerator.Generate();

            PersonAge playerAge = PersonAge.FromDate(dob, _game.CurrentDate);

            Location           birthLocation    = _birthLocationGenerator.Generate(countries.FirstOrDefault());
            Foot               playerFoot       = _favouriteFootGenerator.Generate();
            Percentile         percentile       = _percentileGenerator.Generate();
            BodyMassIndex      bmi              = _bmiGenerator.Generate(countries.FirstOrDefault(), playerGender.Value, percentile, dob);
            PlayerPosition     position         = _playerPositionGenerator.Generate();
            PhysicalFeatureSet playerFeatureSet = _physicalFeatureSetGenerator.Generate(position, bmi, countries.FirstOrDefault(), playerAge);

            // first name & last name => according to the player's country
            return(new PlayerBuilder()
                   .WithName(playerName)
                   .WithGender(playerGender.Value)
                   .WithBirthInfo(new BirthInfo(dob, birthLocation))
                   .WithFoot(playerFoot)
                   .WithPercentile(percentile)
                   .WithBodyMassIndex(bmi)
                   .WithPlayerPosition(position)
                   .WithFeatureSet(playerFeatureSet)
                   .WithCountries(countries)
                   .Build());
        }
예제 #2
0
        public IActionResult GenerateDoB()
        {
            var dob = _dateOfBirthGenerator.Generate();

            return(Ok(dob));
        }