本文整理汇总了C#中GameObjects.Person.LoadTitleFromString方法的典型用法代码示例。如果您正苦于以下问题:C# Person.LoadTitleFromString方法的具体用法?C# Person.LoadTitleFromString怎么用?C# Person.LoadTitleFromString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameObjects.Person
的用法示例。
在下文中一共展示了Person.LoadTitleFromString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadGameDataFromDataBase
//.........这里部分代码省略.........
person.RewardFinished = (bool)reader["RewardFinished"];
person.WorkKind = (ArchitectureWorkKind)((short)reader["WorkKind"]);
person.OldWorkKind = (ArchitectureWorkKind)((short)reader["OldWorkKind"]);
person.RecruitmentMilitary = null;
person.ArrivingDays = (short)reader["ArrivingDays"];
person.TaskDays = (short)reader["TaskDays"];
person.OutsideTask = (OutsideTaskKind)((short)reader["OutsideTask"]);
person.OutsideDestination = StaticMethods.LoadFromString(reader["OutsideDestination"].ToString());
person.ConvincingPersonID = (short)reader["ConvincingPerson"];
person.InformationKindID = (short)reader["InformationKind"];
str = reader["ClosePersons"].ToString();
strArray = str.Split(separator, StringSplitOptions.RemoveEmptyEntries);
intArray = new int[strArray.Length];
for (int i = 0; i < strArray.Length; i++)
{
intArray[i] = int.Parse(strArray[i]);
}
closeIds.Add(person.ID, intArray);
str = reader["HatedPersons"].ToString();
strArray = str.Split(separator, StringSplitOptions.RemoveEmptyEntries);
intArray = new int[strArray.Length];
for (int i = 0; i < strArray.Length; i++)
{
intArray[i] = int.Parse(strArray[i]);
}
hatedIds.Add(person.ID, intArray);
person.Skills.LoadFromString(this.GameCommonData.AllSkills, reader["Skills"].ToString());
try
{
person.LoadTitleFromString(reader["Title"].ToString(), this.GameCommonData.AllTitles);
}
catch
{
Title t = this.GameCommonData.AllTitles.GetTitle((short)reader["PersonalTitle"]);
if (t != null)
{
person.RealTitles.Add(t);
}
t = this.GameCommonData.AllTitles.GetTitle((short)reader["CombatTitle"]);
if (t != null)
{
person.RealTitles.Add(t);
}
}
person.StudyingTitle = this.GameCommonData.AllTitles.GetTitle((short)reader["StudyingTitle"]);
person.huaiyun = (bool)reader["huaiyun"];
person.faxianhuaiyun = (bool)reader["faxianhuaiyun"];
person.huaiyuntianshu = short.Parse(reader["huaiyuntianshu"].ToString());
try
{
person.suoshurenwu = (short)reader["suoshurenwu"];
}
catch
{
}
try
{
person.Stunts.LoadFromString(this.GameCommonData.AllStunts, reader["Stunts"].ToString());
示例2: LoadGameDataFromDataBase
//.........这里部分代码省略.........
strArray = str.Split(separator, StringSplitOptions.RemoveEmptyEntries);
intArray = new int[strArray.Length];
for (int i = 0; i < strArray.Length; i++)
{
intArray[i] = int.Parse(strArray[i]);
}
closeIds.Add(person.ID, intArray);
}
catch
{
errors.Add("亲爱武将一栏应为半型空格分隔的人物ID");
}
try
{
str = reader["HatedPersons"].ToString();
strArray = str.Split(separator, StringSplitOptions.RemoveEmptyEntries);
intArray = new int[strArray.Length];
for (int i = 0; i < strArray.Length; i++)
{
intArray[i] = int.Parse(strArray[i]);
}
hatedIds.Add(person.ID, intArray);
}
catch
{
errors.Add("厌恶武将一栏应为半型空格分隔的人物ID");
}
person.Skills.LoadFromString(this.GameCommonData.AllSkills, reader["Skills"].ToString());
try
{
errors.AddRange(person.LoadTitleFromString(reader["Title"].ToString(), this.GameCommonData.AllTitles));
}
catch
{
Title t = this.GameCommonData.AllTitles.GetTitle((short)reader["PersonalTitle"]);
if (t != null)
{
person.RealTitles.Add(t);
}
t = this.GameCommonData.AllTitles.GetTitle((short)reader["CombatTitle"]);
if (t != null)
{
person.RealTitles.Add(t);
}
}
person.StudyingTitle = this.GameCommonData.AllTitles.GetTitle((short)reader["StudyingTitle"]);
person.huaiyun = (bool)reader["huaiyun"];
person.faxianhuaiyun = (bool)reader["faxianhuaiyun"];
person.huaiyuntianshu = short.Parse(reader["huaiyuntianshu"].ToString());
try
{
person.suoshurenwu = (short)reader["suoshurenwu"];
}
catch
{
}
try
{
person.Stunts.LoadFromString(this.GameCommonData.AllStunts, reader["Stunts"].ToString());