public void RandInfo(TDBaseNameData nameData, AgeRange range = AgeRange.Adult, Gender gender = Gender.Male, string lastName = null) { IsCelebrity = false; AgeRange = range; Gender = gender; NameLib = nameData.TDID; Age = RandUtil.RangeInt(AgeRangeData[AgeRange]); NameData = GetNameData(NameLib); HeadIcon = NameData.RandHeadIcon(Gender, Const.PTag_Normal); if (lastName.IsInv()) { LastName = NameData.RandLastNameKey(); } else { if (BaseLanguageMgr.AllLastNames.Contains(lastName)) { LastName = lastName; } else { throw new Exception("没有这个姓氏:" + lastName); } } if (FirstName.IsInv()) { FirstName = NameData.RandFirstNameKey(Gender); } OnRandInfo(); }
public void Generate() { IsCelebrity = true; AgeRange = GetAgeRange(); NameData = GetNameData(NameLib); HeadIcon = NameData.RandHeadIcon(Gender, Const.PTag_Normal); OnGenerate(); }
public virtual TData RandPerson(TDBaseNameData nameData, AgeRange range = AgeRange.Adult, Gender gender = Gender.Male, string lastName = null, Func <TData, TData> onProcessInfo = null) { TData person = new TData(); if (onProcessInfo != null) { person = onProcessInfo.Invoke(person); } person.RandInfo(nameData, range, gender, lastName); SpawnAdd(person, person.GetTDID()); return(person); }
public override void OnBeAdded(BaseCoreMono selfMono, params object[] obj) { base.OnBeAdded(selfMono, obj); NameData = GetNameData(NameLib); AgeRange = GetAgeRange(); }