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


C# Person.GetRelation方法代码示例

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


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

示例1: CheckConditionKind

 public override bool CheckConditionKind(Person person)
 {
     return person.BelongedFactionWithPrincess != null && person.GetRelation(person.BelongedFactionWithPrincess.Leader) >= this.number;
 }
开发者ID:kpxp,项目名称:ZhongHuaSanGuoZhi-New-Code,代码行数:4,代码来源:ConditionKind850.cs

示例2: createChildren


//.........这里部分代码省略.........
                    calmness = b.Calmness;
                    personalLoyalty = b.PersonalLoyalty;
                    ambition = b.Ambition;

                    if (b.Text.Count > 0)
                    {
                        adjectives.Add(b.Text[GameObject.Random(b.Text.Count)]);
                    }
                    if (b.SuffixText.Count > 0)
                    {
                        suffixes.Add(b.SuffixText[GameObject.Random(b.SuffixText.Count)]);
                    }
                }
            }
            if (adjectives.Count > 0)
            {
                foreach (String s in adjectives)
                {
                    biography += s + ",";
                }
                biography = biography.Substring(0, biography.Length - 1);
                if (adjectives.Count > 0)
                {
                    biography += "的" + (suffixes.Count > 0 ? suffixes[GameObject.Random(suffixes.Count)] : "將領");
                }
                biography += "。";
            }

            Biography bio = new Biography();
            bio.Brief = biography;
            bio.ID = r.ID;
            Biography fatherBio = father.Scenario.GameCommonData.AllBiographies.GetBiography(father.ID);
            if (fatherBio != null)
            {
                bio.FactionColor = fatherBio.FactionColor;
                bio.MilitaryKinds = fatherBio.MilitaryKinds;
            }
            else
            {
                bio.FactionColor = 52;
                bio.MilitaryKinds.AddBasicMilitaryKinds(father.Scenario);
            }
            father.Scenario.GameCommonData.AllBiographies.AddBiography(bio);
            r.PersonBiography = bio;

            /*r.LocationArchitecture = father.BelongedArchitecture; //mother has no location arch!
            r.BelongedFaction = r.BelongedArchitecture.BelongedFaction;
            r.Available = true;*/
            r.Alive = true;

            father.Scenario.Persons.Add(r);

            r.Scenario = father.Scenario;

            foreach (Person p in father.Scenario.Persons)
            {
                int fatherRel = father.GetRelation(p);
                int motherRel = mother.GetRelation(p);

                if (fatherRel != 0 && motherRel != 0)
                {
                    int rel = GameObject.Random(Math.Abs(fatherRel - motherRel)) + Math.Min(fatherRel, motherRel);
                    p.SetRelation(p, rel);
                }
            }

            foreach (Person p in father.GetClosePersons())
            {
                if (!GameObject.Chance((int)r.personalLoyalty * 25))
                {
                    r.AddClose(p);
                }
            }
            foreach (Person p in father.GetClosePersons())
            {
                if (!GameObject.Chance((int)r.personalLoyalty * 25))
                {
                    r.AddClose(p);
                }
            }

            foreach (Person p in father.GetHatedPersons())
            {
                if (!GameObject.Chance((int)r.personalLoyalty * 25))
                {
                    r.AddHated(p);
                }
            }
            foreach (Person p in father.GetHatedPersons())
            {
                if (!GameObject.Chance((int)r.personalLoyalty * 25))
                {
                    r.AddHated(p);
                }
            }

            ExtensionInterface.call("CreateChildren", new Object[] { father.Scenario, r });

            return r;
        }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:101,代码来源:Person.cs


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