Esempio n. 1
0
 public Nobility(NobilityCategoryType category, NameGenderType gender, int ranking, string title)
 {
     this.Category = category;
     this.Gender   = gender;
     this.Ranking  = ranking;
     this.Title    = title;
 }
Esempio n. 2
0
 public RandomName(NameCategoryType nameCategoryType, NameGenderType nameGenderType, string givenName, string surname)
 {
     this.Category  = nameCategoryType;
     this.Gender    = nameGenderType;
     this.GivenName = givenName;
     this.Surname   = surname;
 }
Esempio n. 3
0
        public static RandomName GetRandomName(NameCategoryType category, NameGenderType gender)
        {
            NameGenderType selectedGender;

            var givenName       = "";
            var surname         = "";
            var randomGenerator = new Random();
            var categoryData    = NamesManagement.NameData.Where(a => a.Category == category).FirstOrDefault();

            if (gender == NameGenderType.Unisex)
            {
                if (randomGenerator.Next(2) == 0)
                {
                    selectedGender = NameGenderType.Female;
                }
                else
                {
                    selectedGender = NameGenderType.Male;
                }
            }
            else
            {
                selectedGender = gender;
            }

            if (selectedGender == NameGenderType.Female)
            {
                givenName = categoryData.FemaleNames[randomGenerator.Next(categoryData.FemaleNames.Count)];
            }
            else
            {
                givenName = categoryData.MaleNames[randomGenerator.Next(categoryData.MaleNames.Count)];
            }

            if (categoryData.HasSurnames)
            {
                surname = categoryData.Surnames[randomGenerator.Next(categoryData.Surnames.Count)];
            }

            return(new RandomName(category, selectedGender, givenName, surname));
        }
Esempio n. 4
0
 public Title(NameGenderType gender, string name, string description)
 {
     this.Gender      = gender;
     this.Name        = name;
     this.Description = description;
 }