public Settler.Settler GenerateParent(bool isMale) { int age = (int)(Math.Pow(new Random().NextDouble(), 0.2) * Varsk.VarskElderYears + Varsk.VarskAdultYears) * Date.DaysInYear; NameFactory name = isMale ? VarskNameFactories.Male() : VarskNameFactories.Female(); var settler = new Varsk(new Date(-1 * age), name.Generate(), $"{VarskNameFactories.Male().Generate()}sson", isMale ? BinaryGender.Male : BinaryGender.Female); TraitGenerator.GenerateTraits(settler); return(settler); }
public Settler.Settler GenerateChild(Varsk father, Varsk mother) { int minParentAge = Math.Min(-1 * father.Birthday.DaysSinceSettlement, -1 * mother.Birthday.DaysSinceSettlement); int age = new Random().Next(minParentAge - Varsk.VarskAdultYears * Date.DaysInYear); bool isMale = new Random().Next(2) == 0; NameFactory name = isMale ? VarskNameFactories.Male() : VarskNameFactories.Female(); var child = new Varsk(new Date(-1 * age), name.Generate(), $"{(father.PrestigeLevel >= mother.PrestigeLevel ? father.GivenName : mother.GivenName)}sson", isMale ? BinaryGender.Male : BinaryGender.Female); ParentChildRelationship.Make(_manager, 0, father, child); ParentChildRelationship.Make(_manager, 0, mother, child); Inheritor.GenerateChildTraits(child); return(child); }