当前位置: 首页>>代码示例>>C#>>正文


C# Person.LoadTitleFromString方法代码示例

本文整理汇总了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());
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:67,代码来源:GameScenario.cs

示例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());
开发者ID:hero1991,项目名称:ZhongHuaSanGuoZhi,代码行数:67,代码来源:GameScenario.cs


注:本文中的GameObjects.Person.LoadTitleFromString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。