Beispiel #1
0
 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();
 }
Beispiel #2
0
 public void Generate()
 {
     IsCelebrity = true;
     AgeRange    = GetAgeRange();
     NameData    = GetNameData(NameLib);
     HeadIcon    = NameData.RandHeadIcon(Gender, Const.PTag_Normal);
     OnGenerate();
 }