public Nobility(NobilityCategoryType category, NameGenderType gender, int ranking, string title) { this.Category = category; this.Gender = gender; this.Ranking = ranking; this.Title = title; }
public RandomName(NameCategoryType nameCategoryType, NameGenderType nameGenderType, string givenName, string surname) { this.Category = nameCategoryType; this.Gender = nameGenderType; this.GivenName = givenName; this.Surname = surname; }
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)); }
public Title(NameGenderType gender, string name, string description) { this.Gender = gender; this.Name = name; this.Description = description; }