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


C# Person.RemoveHated方法代码示例

本文整理汇总了C#中GameObjects.Person.RemoveHated方法的典型用法代码示例。如果您正苦于以下问题:C# Person.RemoveHated方法的具体用法?C# Person.RemoveHated怎么用?C# Person.RemoveHated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameObjects.Person的用法示例。


在下文中一共展示了Person.RemoveHated方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SavePersonBasicData

        private void SavePersonBasicData(Person p)
        {
            try
            {
                p.SurName = this.tbSurName.Text;
                p.GivenName = this.tbGivenName.Text;
                p.CalledName = this.tbCalledName.Text;
                p.PictureIndex = int.Parse(this.tbPic.Text);
                p.Ideal = int.Parse(this.tbIdeal.Text);
                p.IdealTendency = this.cbIdealTendency.SelectedItem as IdealTendencyKind;
                p.BornRegion = (PersonBornRegion) this.cbBornRegion.SelectedIndex;
                p.AvailableLocation = int.Parse(this.tbAvailableLocation.Text);
                p.YearAvailable = int.Parse(this.tbAvailableYear.Text);
                p.YearBorn = int.Parse(this.tbBornYear.Text);
                p.YearDead = int.Parse(this.tbDeadYear.Text);
                p.DeadReason = (PersonDeadReason) this.cbDeadReason.SelectedIndex;
                p.Strength = int.Parse(this.tbStrength.Text);
                p.Command = int.Parse(this.tbCommand.Text);
                p.Intelligence = int.Parse(this.tbIntelligence.Text);
                p.Politics = int.Parse(this.tbPolitics.Text);
                p.Glamour = int.Parse(this.tbGlamour.Text);
                p.StrengthExperience = int.Parse(this.tbStrengthExperience.Text);
                p.CommandExperience = int.Parse(this.tbCommandExperience.Text);
                p.IntelligenceExperience = int.Parse(this.tbIntelligenceExperience.Text);
                p.PoliticsExperience = int.Parse(this.tbPoliticsExperience.Text);
                p.GlamourExperience = int.Parse(this.tbGlamourExperience.Text);
                p.Braveness = int.Parse(this.tbBraveness.Text);
                p.Calmness = int.Parse(this.tbCalmness.Text);
                p.Loyalty = int.Parse(this.tbLoyalty.Text);
                p.Character = p.Scenario.GameCommonData.AllCharacterKinds[this.cbCharacter.SelectedIndex];
                p.Strain = int.Parse(this.tbStrain.Text);
                int t;
                int.TryParse(this.tbFather.Text, out t);
                p.Father = p.Scenario.Persons.GetGameObject(t) as Person;
                int.TryParse(this.tbMother.Text, out t);
                p.Mother = p.Scenario.Persons.GetGameObject(t) as Person;
                int.TryParse(this.tbSpouse.Text, out t);
                p.Spouse = p.Scenario.Persons.GetGameObject(t) as Person;

                p.Brothers.Clear();
                char[] separator = new char[] { ' ', '\n', '\r', '\t' };
                string[] strArray = this.tbBrother.Text.Split(separator, StringSplitOptions.RemoveEmptyEntries);
                foreach (String s in strArray)
                {
                    int.TryParse(s, out t);
                    Person q = this.Persons.GetGameObject(t) as Person;
                    p.Brothers.Add(q);
                }

                p.Generation = int.Parse(this.tbGeneration.Text);
                p.PersonalLoyalty = (int) this.cbPersonalLoyalty.SelectedIndex;
                p.Ambition = (int) this.cbAmbition.SelectedIndex;
                p.Qualification = (PersonQualification) this.cbQualification.SelectedIndex;
                p.ValuationOnGovernment = (PersonValuationOnGovernment) this.cbValuationOnGovernment.SelectedIndex;
                p.StrategyTendency = (PersonStrategyTendency) this.cbStrategyTendency.SelectedIndex;
                try
                {
                    StaticMethods.LoadFromString(p.JoinFactionID, this.tbOldFactionID.Text);
                }
                catch
                {
                }

                PersonList pl = p.GetClosePersons();
                foreach (Person q in pl)
                {
                    p.RemoveClose(q);
                }
                pl = p.GetHatedPersons();
                foreach (Person q in pl)
                {
                    p.RemoveHated(q);
                }

                foreach (string str in this.lbClosePersons.Items)
                {
                    int id = int.Parse(str.Substring(0, str.IndexOf(" ")));
                    p.AddClose(p.Scenario.Persons.GetGameObject(id) as Person);
                }

                foreach (string str in this.lbHatedPersons.Items)
                {
                    int id = int.Parse(str.Substring(0, str.IndexOf(" ")));
                    p.AddHated(p.Scenario.Persons.GetGameObject(id) as Person);
                }
            }
            catch
            {
                MessageBox.Show("请输入正确的数据格式。");
            }
        }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:91,代码来源:frmEditPerson.cs


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