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


C# ArchitectureList.Add方法代码示例

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


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

示例1: EditArchitectures

 private void EditArchitectures()
 {
     ArchitectureList list = new ArchitectureList();
     for (int i = 0; i < this.dgvArchitectures.SelectedRows.Count; i++)
     {
         list.Add(this.Architectures[this.dgvArchitectures.SelectedRows[i].Index]);
     }
     frmEditArchitecture architecture = new frmEditArchitecture();
     architecture.MainForm = this.MainForm;
     architecture.Architectures = list;
     architecture.ShowDialog();
     this.dgvArchitectures.Invalidate();
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:13,代码来源:frmArchitectureList.cs

示例2: GetOtherArchitectureList

 public ArchitectureList GetOtherArchitectureList(Architecture architecture)
 {
     ArchitectureList list = new ArchitectureList();
     foreach (Architecture architecture2 in this.Architectures)
     {
         if (architecture2 != architecture)
         {
             list.Add(architecture2);
         }
     }
     return list;
 }
开发者ID:k45399735,项目名称:ZhongHuaSanGuoZhi,代码行数:12,代码来源:Section.cs

示例3: jingongjianzhuliebiao

 public ArchitectureList jingongjianzhuliebiao()
 {
     ArchitectureList jianzhuliebiao = new ArchitectureList();
     if (base.Scenario.youhuangdi())
     {
         jianzhuliebiao.Add(base.Scenario.huangdisuozaijianzhu());
     }
     return jianzhuliebiao;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:9,代码来源:Architecture.cs

示例4: GetClosestArchitectures

 public ArchitectureList GetClosestArchitectures(int count, double maxDistance)
 {
     if (this.ClosestArchitectures == null)
     {
         this.GetClosestArchitectures();
     }
     ArchitectureList list = new ArchitectureList();
     if (count > this.ClosestArchitectures.Count)
     {
         count = this.ClosestArchitectures.Count;
     }
     for (int i = 0; i < count; i++)
     {
         if (base.Scenario.GetDistance(this.ArchitectureArea, (this.ClosestArchitectures[i] as Architecture).ArchitectureArea) <= maxDistance)
         {
             list.Add(this.ClosestArchitectures[i]);
         }
         else
         {
             break;
         }
     }
     if (list.Count == 0)
     {
         list.Add(this.ClosestArchitectures[0]);
     }
     return list;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:28,代码来源:Architecture.cs

示例5: ArchitectureListWithoutSelf

 public ArchitectureList ArchitectureListWithoutSelf()
 {
     ArchitectureList architectureList=new ArchitectureList() ;
     foreach (Architecture architecture in base.Scenario.Architectures)
     {
         architectureList.Add(architecture);
     }
     architectureList.Remove(this);
     return architectureList;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:10,代码来源:Architecture.cs

示例6: OutsideTacticsAI

        private void OutsideTacticsAI()
        {
            ConvinceNoFactionAI();

            if (this.PlanArchitecture == null && this.RecentlyAttacked <= 0 && this.HasPerson() && this.IsFundEnough)
            {
                Architecture architecture2;
                int diplomaticRelation;
                Person firstHalfPerson;
                ArchitectureList unknownArch = new ArchitectureList();
                ArchitectureList knownArch = new ArchitectureList();
                foreach (Architecture architecture in this.GetClosestArchitectures(20, 40))
                {
                    if (!this.BelongedFaction.IsArchitectureKnown(architecture))
                    {
                        unknownArch.Add(architecture);
                    }
                    else
                    {
                        knownArch.Add(architecture);
                    }
                }
                if (this.BelongedSection != null && (unknownArch.Count > 0) && this.BelongedSection.AIDetail.AllowInvestigateTactics)
                {
                    if (unknownArch.Count > 1)
                    {
                        unknownArch.PropertyName = "Population";
                        unknownArch.IsNumber = true;
                        unknownArch.ReSort();
                    }
                    if ((((this.RecentlyAttacked <= 0) && (GameObject.Random(40) < GameObject.Random(unknownArch.Count))) && GameObject.Chance(20)) && this.InformationAvail())
                    {
                        architecture2 = unknownArch[GameObject.Random(unknownArch.Count / 2)] as Architecture;
                        if ((!this.BelongedFaction.IsArchitectureKnown(architecture2) || GameObject.Chance(20)) && ((architecture2.BelongedFaction != null) && (!this.IsFriendly(architecture2.BelongedFaction) || GameObject.Chance(10))))
                        {
                            diplomaticRelation = base.Scenario.GetDiplomaticRelation(this.BelongedFaction.ID, architecture2.BelongedFaction.ID);
                            if (((diplomaticRelation >= 0) && (GameObject.Random(diplomaticRelation + 200) <= GameObject.Random(50))) || ((diplomaticRelation < 0) && (GameObject.Random(Math.Abs(diplomaticRelation) + 100) >= GameObject.Random(100))))
                            {
                                firstHalfPerson = this.GetFirstHalfPerson("InformationAbility");
                                if ((((firstHalfPerson != null) && (!this.HasFollowedLeaderMilitary(firstHalfPerson) || GameObject.Chance(10))) && (GameObject.Random(firstHalfPerson.NonFightingNumber) > GameObject.Random(firstHalfPerson.FightingNumber))) && (GameObject.Random(firstHalfPerson.FightingNumber) < 100))
                                {
                                    firstHalfPerson.CurrentInformationKind = this.GetFirstHalfInformationKind();
                                    if (firstHalfPerson.CurrentInformationKind != null)
                                    {
                                        firstHalfPerson.GoForInformation(base.Scenario.GetClosestPoint(architecture2.ArchitectureArea, this.Position));
                                    }
                                }
                            }
                        }
                    }
                }
                if ((this.BelongedSection != null) && ((knownArch.Count > 0) && (this.PlanArchitecture == null)) && this.BelongedSection.AIDetail.AllowPersonTactics)
                {
                    if (knownArch.Count > 1)
                    {
                        knownArch.PropertyName = "PersonCount";
                        knownArch.IsNumber = true;
                        knownArch.ReSort();
                    }
                    if ((this.HasPerson() && (GameObject.Random(this.Fund) >= this.GossipArchitectureFund)) && GameObject.Chance(50))
                    {
                        ArchitectureList list3 = new ArchitectureList();
                        foreach (Architecture architecture in knownArch)
                        {
                            if ((architecture.BelongedFaction != this.BelongedFaction) && (architecture.BelongedFaction != null))
                            {
                                list3.Add(architecture);
                            }
                        }
                        if (list3.Count > 0)
                        {
                            architecture2 = list3[GameObject.Random(list3.Count / 2)] as Architecture;
                            if (GameObject.Chance(100 - architecture2.noEscapeChance * 2))
                            {
                                if ((!this.IsFriendly(architecture2.BelongedFaction) || GameObject.Chance(10)) && ((architecture2.Fund < architecture2.EnoughFund) || ((architecture2.Fund < architecture2.AbundantFund) && GameObject.Chance(20))))
                                {
                                    diplomaticRelation = base.Scenario.GetDiplomaticRelation(this.BelongedFaction.ID, architecture2.BelongedFaction.ID);
                                    if (((diplomaticRelation >= 0) && (GameObject.Random(diplomaticRelation + 200) <= GameObject.Random(50))) || ((diplomaticRelation < 0) && (GameObject.Random(Math.Abs(diplomaticRelation) + 100) >= GameObject.Random(100))))
                                    {
                                        firstHalfPerson = this.GetFirstHalfPerson("GossipAbility");
                                        if (((((firstHalfPerson != null) && (!this.HasFollowedLeaderMilitary(firstHalfPerson) || GameObject.Chance(10))) && (GameObject.Random(firstHalfPerson.NonFightingNumber) > GameObject.Random(firstHalfPerson.FightingNumber))) && (GameObject.Random(firstHalfPerson.FightingNumber) < 100)) && ((GameObject.Random(architecture2.GetGossipablePersonCount() + 4) >= 4) && (GameObject.Random(firstHalfPerson.GossipAbility) >= 200)))
                                        {
                                            firstHalfPerson.GoForGossip(base.Scenario.GetClosestPoint(architecture2.ArchitectureArea, this.Position));
                                        }
                                    }
                                }
                            }
                        }
                    }
                    if ((this.HasPerson() && (GameObject.Random(this.Fund) >= this.ConvincePersonFund)) && GameObject.Chance(50))
                    {
                        ArchitectureList list4 = new ArchitectureList();
                        foreach (Architecture architecture in knownArch)
                        {
                            if (((architecture.BelongedFaction != this.BelongedFaction) && (architecture.BelongedFaction != null)) && architecture.HasPerson())
                            {
                                list4.Add(architecture);
                            }
                        }
                        foreach (Architecture architecture in this.BelongedFaction.Architectures)
//.........这里部分代码省略.........
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:101,代码来源:Architecture.cs

示例7: OutsideTacticsAI

 private void OutsideTacticsAI()
 {
     if (((this.PlanArchitecture == null) || GameObject.Chance(10)) && (((this.RecentlyAttacked <= 0) && this.HasPerson()) && this.IsFundEnough))
     {
         Architecture architecture2;
         int diplomaticRelation;
         Person firstHalfPerson;
         ArchitectureList list = new ArchitectureList();
         ArchitectureList list2 = new ArchitectureList();
         foreach (Architecture architecture in this.GetClosestArchitectures(20, 40))
         {
             if (!this.BelongedFaction.IsArchitectureKnown(architecture))
             {
                 list.Add(architecture);
             }
             else
             {
                 list2.Add(architecture);
             }
         }
         /*if (this.BelongedSection != null && (list.Count > 0) && this.BelongedSection.AIDetail.AllowInvestigateTactics)
         {
             if (list.Count > 1)
             {
                 list.PropertyName = "Population";
                 list.IsNumber = true;
                 list.ReSort();
             }
             if ((((this.RecentlyAttacked <= 0) && (GameObject.Random(40) < GameObject.Random(list.Count))) && GameObject.Chance(20)) && this.InformationAvail())
             {
                 architecture2 = list[GameObject.Random(list.Count / 2)] as Architecture;
                 if ((!this.BelongedFaction.IsArchitectureKnown(architecture2) || GameObject.Chance(20)) && ((architecture2.BelongedFaction != null) && (!this.IsFriendly(architecture2.BelongedFaction) || GameObject.Chance(10))))
                 {
                     diplomaticRelation = base.Scenario.GetDiplomaticRelation(this.BelongedFaction.ID, architecture2.BelongedFaction.ID);
                     if (((diplomaticRelation >= 0) && (GameObject.Random(diplomaticRelation + 200) <= GameObject.Random(50))) || ((diplomaticRelation < 0) && (GameObject.Random(Math.Abs(diplomaticRelation) + 100) >= GameObject.Random(100))))
                     {
                         firstHalfPerson = this.GetFirstHalfPerson("InformationAbility");
                         if ((((firstHalfPerson != null) && (!this.HasFollowedLeaderMilitary(firstHalfPerson) || GameObject.Chance(10))) && (GameObject.Random(firstHalfPerson.NonFightingNumber) > GameObject.Random(firstHalfPerson.FightingNumber))) && (GameObject.Random(firstHalfPerson.FightingNumber) < 100))
                         {
                             firstHalfPerson.CurrentInformationKind = this.GetFirstHalfInformationKind();
                             if (firstHalfPerson.CurrentInformationKind != null)
                             {
                                 firstHalfPerson.GoForInformation(base.Scenario.GetClosestPoint(architecture2.ArchitectureArea, this.Position));
                             }
                         }
                     }
                 }
             }
             if (((this.PlanArchitecture == null) && (GameObject.Random(40) < GameObject.Random(list.Count))) && (this.HasPerson() && (GameObject.Random(this.Fund) >= this.SpyArchitectureFund)))
             {
                 architecture2 = list[GameObject.Random(list.Count / 2)] as Architecture;
                 if ((!architecture2.HasFactionSpy(this.BelongedFaction) || GameObject.Chance(20)) && (((architecture2.BelongedFaction != null) && (GameObject.Random(architecture2.AreaCount + 4) >= 4)) && (!this.IsFriendly(architecture2.BelongedFaction) || GameObject.Chance(10))))
                 {
                     diplomaticRelation = base.Scenario.GetDiplomaticRelation(this.BelongedFaction.ID, architecture2.BelongedFaction.ID);
                     if (((diplomaticRelation >= 0) && (GameObject.Random(diplomaticRelation + 200) <= GameObject.Random(50))) || ((diplomaticRelation < 0) && (GameObject.Random(Math.Abs(diplomaticRelation) + 100) >= GameObject.Random(100))))
                     {
                         firstHalfPerson = this.GetFirstHalfPerson("SpyAbility");
                         if (((((firstHalfPerson != null) && (!this.HasFollowedLeaderMilitary(firstHalfPerson) || GameObject.Chance(10))) && (GameObject.Random(firstHalfPerson.NonFightingNumber) > GameObject.Random(firstHalfPerson.FightingNumber))) && (GameObject.Random(firstHalfPerson.FightingNumber) < 100)) && (GameObject.Random(firstHalfPerson.SpyAbility) >= 200))
                         {
                             firstHalfPerson.GoForSpy(base.Scenario.GetClosestPoint(architecture2.ArchitectureArea, this.Position));
                         }
                     }
                 }
             }
         }*/
         if ((this.BelongedSection != null) && ((list2.Count > 0) && (this.PlanArchitecture == null)) && this.BelongedSection.AIDetail.AllowPersonTactics)
         {
             if (list2.Count > 1)
             {
                 list2.PropertyName = "PersonCount";
                 list2.IsNumber = true;
                 list2.ReSort();
             }
             if ((this.HasPerson() && (GameObject.Random(this.Fund) >= this.GossipArchitectureFund)) && GameObject.Chance(50))
             {
                 ArchitectureList list3 = new ArchitectureList();
                 foreach (Architecture architecture in list2)
                 {
                     if ((architecture.BelongedFaction != this.BelongedFaction) && (architecture.BelongedFaction != null))
                     {
                         list3.Add(architecture);
                     }
                 }
                 if (list3.Count > 0)
                 {
                     architecture2 = list3[GameObject.Random(list3.Count / 2)] as Architecture;
                     if (GameObject.Chance(100 - architecture2.noEscapeChance * 2))
                     {
                         if ((!this.IsFriendly(architecture2.BelongedFaction) || GameObject.Chance(10)) && ((architecture2.Fund < architecture2.EnoughFund) || ((architecture2.Fund < architecture2.AbundantFund) && GameObject.Chance(20))))
                         {
                             diplomaticRelation = base.Scenario.GetDiplomaticRelation(this.BelongedFaction.ID, architecture2.BelongedFaction.ID);
                             if (((diplomaticRelation >= 0) && (GameObject.Random(diplomaticRelation + 200) <= GameObject.Random(50))) || ((diplomaticRelation < 0) && (GameObject.Random(Math.Abs(diplomaticRelation) + 100) >= GameObject.Random(100))))
                             {
                                 firstHalfPerson = this.GetFirstHalfPerson("GossipAbility");
                                 if (((((firstHalfPerson != null) && (!this.HasFollowedLeaderMilitary(firstHalfPerson) || GameObject.Chance(10))) && (GameObject.Random(firstHalfPerson.NonFightingNumber) > GameObject.Random(firstHalfPerson.FightingNumber))) && (GameObject.Random(firstHalfPerson.FightingNumber) < 100)) && ((GameObject.Random(architecture2.GetGossipablePersonCount() + 4) >= 4) && (GameObject.Random(firstHalfPerson.GossipAbility) >= 200)))
                                 {
                                     firstHalfPerson.GoForGossip(base.Scenario.GetClosestPoint(architecture2.ArchitectureArea, this.Position));
                                 }
                             }
                         }
//.........这里部分代码省略.........
开发者ID:kanjianlema,项目名称:ZhongHuaSanGuoZhi,代码行数:101,代码来源:Architecture.cs

示例8: OutsideTacticsAI

 private void OutsideTacticsAI()
 {
     if (((this.PlanArchitecture == null) || GameObject.Chance(10)) && (((this.RecentlyAttacked <= 0) && this.HasPerson()) && this.IsFundEnough))
     {
         Architecture architecture2;
         int diplomaticRelation;
         Person firstHalfPerson;
         ArchitectureList list = new ArchitectureList();
         ArchitectureList list2 = new ArchitectureList();
         foreach (Architecture architecture in this.GetClosestArchitectures(20))
         {
             if (!this.BelongedFaction.IsArchitectureKnown(architecture))
             {
                 list.Add(architecture);
             }
             else
             {
                 list2.Add(architecture);
             }
         }
         if ((list.Count > 0) && this.BelongedSection.AIDetail.AllowInvestigateTactics)
         {
             if (list.Count > 1)
             {
                 list.PropertyName = "Population";
                 list.IsNumber = true;
                 list.ReSort();
             }
             if ((((this.RecentlyAttacked <= 0) && (GameObject.Random(40) < GameObject.Random(list.Count))) && GameObject.Chance(20)) && this.InformationAvail())
             {
                 architecture2 = list[GameObject.Random(list.Count / 2)] as Architecture;
                 if ((!this.BelongedFaction.IsArchitectureKnown(architecture2) || GameObject.Chance(20)) && ((architecture2.BelongedFaction != null) && (!this.IsFriendly(architecture2.BelongedFaction) || GameObject.Chance(10))))
                 {
                     diplomaticRelation = base.Scenario.GetDiplomaticRelation(this.BelongedFaction.ID, architecture2.BelongedFaction.ID);
                     if (((diplomaticRelation >= 0) && (GameObject.Random(diplomaticRelation + 200) <= GameObject.Random(50))) || ((diplomaticRelation < 0) && (GameObject.Random(Math.Abs(diplomaticRelation) + 100) >= GameObject.Random(100))))
                     {
                         firstHalfPerson = this.GetFirstHalfPerson("InformationAbility");
                         if ((((firstHalfPerson != null) && (!this.HasFollowedLeaderMilitary(firstHalfPerson) || GameObject.Chance(10))) && (GameObject.Random(firstHalfPerson.NonFightingNumber) > GameObject.Random(firstHalfPerson.FightingNumber))) && (GameObject.Random(firstHalfPerson.FightingNumber) < 100))
                         {
                             firstHalfPerson.CurrentInformationKind = this.GetFirstHalfInformationKind();
                             if (firstHalfPerson.CurrentInformationKind != null)
                             {
                                 firstHalfPerson.GoForInformation(base.Scenario.GetClosestPoint(architecture2.ArchitectureArea, this.Position));
                             }
                         }
                     }
                 }
             }
             if (((this.PlanArchitecture == null) && (GameObject.Random(40) < GameObject.Random(list.Count))) && (this.HasPerson() && (GameObject.Random(this.Fund) >= this.SpyArchitectureFund)))
             {
                 architecture2 = list[GameObject.Random(list.Count / 2)] as Architecture;
                 if ((!architecture2.HasFactionSpy(this.BelongedFaction) || GameObject.Chance(20)) && (((architecture2.BelongedFaction != null) && (GameObject.Random(architecture2.AreaCount + 4) >= 4)) && (!this.IsFriendly(architecture2.BelongedFaction) || GameObject.Chance(10))))
                 {
                     diplomaticRelation = base.Scenario.GetDiplomaticRelation(this.BelongedFaction.ID, architecture2.BelongedFaction.ID);
                     if (((diplomaticRelation >= 0) && (GameObject.Random(diplomaticRelation + 200) <= GameObject.Random(50))) || ((diplomaticRelation < 0) && (GameObject.Random(Math.Abs(diplomaticRelation) + 100) >= GameObject.Random(100))))
                     {
                         firstHalfPerson = this.GetFirstHalfPerson("SpyAbility");
                         if (((((firstHalfPerson != null) && (!this.HasFollowedLeaderMilitary(firstHalfPerson) || GameObject.Chance(10))) && (GameObject.Random(firstHalfPerson.NonFightingNumber) > GameObject.Random(firstHalfPerson.FightingNumber))) && (GameObject.Random(firstHalfPerson.FightingNumber) < 100)) && (GameObject.Random(firstHalfPerson.SpyAbility) >= 200))
                         {
                             firstHalfPerson.GoForSpy(base.Scenario.GetClosestPoint(architecture2.ArchitectureArea, this.Position));
                         }
                     }
                 }
             }
         }
         if (((list2.Count > 0) && (this.PlanArchitecture == null)) && this.BelongedSection.AIDetail.AllowPersonTactics)
         {
             if (list2.Count > 1)
             {
                 list2.PropertyName = "PersonCount";
                 list2.IsNumber = true;
                 list2.ReSort();
             }
             if ((this.HasPerson() && (GameObject.Random(this.Fund) >= this.GossipArchitectureFund)) && GameObject.Chance(50))
             {
                 ArchitectureList list3 = new ArchitectureList();
                 foreach (Architecture architecture in list2)
                 {
                     if ((architecture.BelongedFaction != this.BelongedFaction) && (architecture.BelongedFaction != null))
                     {
                         list3.Add(architecture);
                     }
                 }
                 if (list3.Count > 0)
                 {
                     architecture2 = list3[GameObject.Random(list3.Count / 2)] as Architecture;
                     if ((!this.IsFriendly(architecture2.BelongedFaction) || GameObject.Chance(10)) && ((architecture2.Fund < architecture2.EnoughFund) || ((architecture2.Fund < architecture2.AbundantFund) && GameObject.Chance(20))))
                     {
                         diplomaticRelation = base.Scenario.GetDiplomaticRelation(this.BelongedFaction.ID, architecture2.BelongedFaction.ID);
                         if (((diplomaticRelation >= 0) && (GameObject.Random(diplomaticRelation + 200) <= GameObject.Random(50))) || ((diplomaticRelation < 0) && (GameObject.Random(Math.Abs(diplomaticRelation) + 100) >= GameObject.Random(100))))
                         {
                             firstHalfPerson = this.GetFirstHalfPerson("GossipAbility");
                             if (((((firstHalfPerson != null) && (!this.HasFollowedLeaderMilitary(firstHalfPerson) || GameObject.Chance(10))) && (GameObject.Random(firstHalfPerson.NonFightingNumber) > GameObject.Random(firstHalfPerson.FightingNumber))) && (GameObject.Random(firstHalfPerson.FightingNumber) < 100)) && ((GameObject.Random(architecture2.GetGossipablePersonCount() + 4) >= 4) && (GameObject.Random(firstHalfPerson.GossipAbility) >= 200)))
                             {
                                 firstHalfPerson.GoForGossip(base.Scenario.GetClosestPoint(architecture2.ArchitectureArea, this.Position));
                             }
                         }
                     }
                 }
             }
//.........这里部分代码省略.........
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:101,代码来源:Architecture_1.cs

示例9: AIPersonTransfer

 private void AIPersonTransfer()
 {
     int num2;
     if ((this.MilitaryCount == 0) && ((this.IsImportant || (this.AreaCount > 1)) || (this.Population > this.RecruitmentPopulationBoundary)))
     {
         this.AIRecruitment(false);
     }
     if ((((this.BelongedFaction.ArchitectureCount > 1) && (this.PersonCount > this.MilitaryCount)) && (this.RecentlyAttacked > 0)) && ((this.Endurance == 0) || ((this.Endurance < 30) && GameObject.Chance(0x21))))
     {
         int num = this.PersonCount - this.MilitaryCount;
         GameObjectList list = new GameObjectList();
         list = this.Persons.GetList();
         if (list.Count > 1)
         {
             list.IsNumber = true;
             list.SmallToBig = true;
             list.PropertyName = "FightingForce";
             list.ReSort();
         }
         Architecture capital = this.BelongedFaction.Capital;
         if (capital == this)
         {
             ArchitectureList otherArchitectureList = this.GetOtherArchitectureList();
             if (otherArchitectureList.Count > 1)
             {
                 otherArchitectureList.IsNumber = true;
                 otherArchitectureList.PropertyName = "ArmyScaleWeighing";
                 otherArchitectureList.ReSort();
             }
             capital = otherArchitectureList[0] as Architecture;
         }
         num2 = 0;
         while (num2 < num)
         {
             (list[num2] as Person).MoveToArchitecture(capital);
             this.RemovePerson(list[num2] as Person);
             if (GameObject.Chance(20))
             {
                 break;
             }
             num2++;
         }
     }
     else if (((this.PersonCount + this.MovingPersons.Count) < this.MilitaryCount) || (this.PlanArchitecture != null))
     {
         if (this.RecentlyAttacked > 0)
         {
             int num3 = (this.MilitaryCount - this.PersonCount) - this.MovingPersons.Count;
             PersonList list3 = new PersonList();
             foreach (Architecture architecture2 in GameObject.Chance(20) ? this.BelongedFaction.Architectures : this.BelongedSection.Architectures)
             {
                 if ((architecture2 != this) && (((architecture2.BelongedSection.AIDetail != null) && architecture2.BelongedSection.AIDetail.AutoRun) && (((architecture2.RecentlyAttacked <= 0) && ((architecture2.PersonCount + architecture2.MovingPersons.Count) >= architecture2.MilitaryCount)) || (((architecture2.Fund < (100 * this.AreaCount)) && (architecture2.Domination >= (architecture2.DominationCeiling * 0.8))) && (architecture2.Endurance >= (architecture2.EnduranceCeiling * 0.2f))))))
                 {
                     foreach (Person person in architecture2.Persons)
                     {
                         if ((!architecture2.HasFollowedLeaderMilitary(person) && (GameObject.Chance(10) || !architecture2.HasExperiencedLeaderMilitary(person))) && (person.Command >= 40))
                         {
                             list3.Add(person);
                         }
                     }
                 }
             }
             if (list3.Count > 0)
             {
                 if (list3.Count > 1)
                 {
                     list3.IsNumber = true;
                     list3.PropertyName = "FightingForce";
                     list3.ReSort();
                 }
                 for (num2 = 0; (num2 < num3) && (num2 < list3.Count); num2++)
                 {
                     Architecture locationArchitecture = (list3[num2] as Person).LocationArchitecture;
                     (list3[num2] as Person).MoveToArchitecture(this);
                     locationArchitecture.RemovePerson(list3[num2] as Person);
                 }
             }
         }
     }
     else if (this.HasPerson() && GameObject.Chance(10))
     {
         PersonList list4 = new PersonList();
         if (this.Kind.HasPopulation && (this.Population < (0x3e8 * this.AreaCount)))
         {
             if (this.IsCapital && (this.Fund >= this.ChangeCapitalCost))
             {
                 Architecture newCapital = this.BelongedFaction.SelectNewCapital();
                 if (newCapital != this)
                 {
                     this.DecreaseFund(this.ChangeCapitalCost);
                     this.BelongedFaction.ChangeCapital(newCapital);
                 }
             }
             foreach (Person person in this.Persons)
             {
                 if (!this.HasFollowedLeaderMilitary(person) && (GameObject.Chance(10) || !this.HasExperiencedLeaderMilitary(person)))
                 {
                     list4.Add(person);
                 }
             }
//.........这里部分代码省略.........
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:101,代码来源:Architecture_1.cs

示例10: GetClosestArchitectures

 public ArchitectureList GetClosestArchitectures(int count)
 {
     if (this.ClosestArchitectures == null)
     {
         this.GetClosestArchitectures();
     }
     ArchitectureList list = new ArchitectureList();
     if (count > this.ClosestArchitectures.Count)
     {
         count = this.ClosestArchitectures.Count;
     }
     for (int i = 0; i < count; i++)
     {
         list.Add(this.ClosestArchitectures[i]);
     }
     return list;
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:17,代码来源:Architecture_1.cs

示例11: GetViewingArchitecturesByPosition

 public ArchitectureList GetViewingArchitecturesByPosition(Point position)
 {
     ArchitectureList list = new ArchitectureList();
     if (!this.PositionOutOfRange(position))
     {
         if (this.MapTileData[position.X, position.Y].ViewingArchitectures == null)
         {
             return list;
         }
         foreach (Architecture architecture in this.MapTileData[position.X, position.Y].ViewingArchitectures)
         {
             list.Add(architecture);
         }
     }
     return list;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:16,代码来源:GameScenario.cs

示例12: GetSupplyArchitecturesByPositionAndFaction

 public ArchitectureList GetSupplyArchitecturesByPositionAndFaction(Point position, Faction faction)
 {
     ArchitectureList list = new ArchitectureList();
     if (!this.PositionOutOfRange(position))
     {
         if (this.MapTileData[position.X, position.Y].SupplyingArchitectures == null)
         {
             return list;
         }
         foreach (Architecture architecture in this.MapTileData[position.X, position.Y].SupplyingArchitectures)
         {
             //if (faction.IsFriendly(architecture.BelongedFaction))
             if (faction == architecture.BelongedFaction)
             {
                 list.Add(architecture);
             }
         }
     }
     return list;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:20,代码来源:GameScenario.cs

示例13: GetRoutewayArchitecturesByPosition

 public ArchitectureList GetRoutewayArchitecturesByPosition(Routeway routeway, Point position)
 {
     ArchitectureList list = new ArchitectureList();
     if (!this.PositionOutOfRange(position))
     {
         foreach (Architecture architecture in routeway.BelongedFaction.Architectures)
         {
             if ((architecture != routeway.StartArchitecture) && architecture.GetRoutewayStartArea().HasPoint(position))
             {
                 list.Add(architecture);
             }
         }
     }
     return list;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:15,代码来源:GameScenario.cs

示例14: ShowAIDetailFrame

 private void ShowAIDetailFrame()
 {
     this.TabListPlugin.InitialValues(this.EditingFaction.Scenario.GameCommonData.AllSectionAIDetails.GetSectionAIDetailList(), this.EditingSection.AIDetail, this.screen.MouseState.ScrollWheelValue, "");
     this.TabListPlugin.SetListKindByName("SectionAIDetail", true, false);
     this.TabListPlugin.SetSelectedTab("");
     this.GameFramePlugin.Kind = FrameKind.Section;
     this.GameFramePlugin.Function = FrameFunction.GetSection;
     this.GameFramePlugin.SetFrameContent(this.TabListPlugin.TabList, this.screen.viewportSize);
     this.GameFramePlugin.OKButtonEnabled = false;
     this.GameFramePlugin.CancelButtonEnabled = true;
     this.GameFramePlugin.SetOKFunction(delegate {
         this.EditingSection.AIDetail = this.TabListPlugin.SelectedItem as SectionAIDetail;
         switch (this.EditingSection.AIDetail.OrientationKind)
         {
             case SectionOrientationKind.军区:
             {
                 SectionList otherSections = this.EditingFaction.GetOtherSections(this.OriginalSection);
                 if (otherSections.Count == 1)
                 {
                     this.EditingSection.OrientationSection = otherSections[0] as Section;
                 }
                 break;
             }
             case SectionOrientationKind.势力:
             {
                 GameObjectList diplomaticRelationListByFactionID = this.EditingFaction.Scenario.DiplomaticRelations.GetDiplomaticRelationListByFactionID(this.EditingFaction.ID);
                 if (diplomaticRelationListByFactionID.Count == 1)
                 {
                     this.EditingSection.OrientationFaction = (diplomaticRelationListByFactionID[0] as DiplomaticRelation).GetDiplomaticFaction(this.EditingFaction.ID);
                 }
                 break;
             }
             case SectionOrientationKind.州域:
             {
                 StateList states = this.EditingFaction.Scenario.States;
                 if (states.Count == 1)
                 {
                     this.EditingSection.OrientationState = states[0] as State;
                 }
                 break;
             }
             case SectionOrientationKind.建筑:
             {
                 ArchitectureList allArch = this.EditingFaction.Scenario.Architectures;
                 ArchitectureList targetArch = new ArchitectureList();
                 foreach (Architecture a in allArch)
                 {
                     if (a.BelongedFaction != this.EditingFaction)
                     {
                         targetArch.Add(a);
                     }
                 }
                 if (targetArch.Count == 1)
                 {
                     this.EditingSection.OrientationArchitecture = targetArch[0] as Architecture;
                 }
                 break;
             }
         }
         this.RefreshOKButton();
         if (this.IsNew)
         {
             this.EditingSection.RefreshSectionName();
         }
         this.RefreshOrientationButton();
         this.RefreshLabelTextsDisplay();
     });
     this.GameFramePlugin.IsShowing = true;
 }
开发者ID:simon217,项目名称:ZhongHuaSanGuoZhi,代码行数:69,代码来源:MarshalSectionDialog.cs

示例15: GetAttackPossibleArchitectures

 private ArchitectureList GetAttackPossibleArchitectures(bool last)
 {
     ArchitectureList list = new ArchitectureList();
     foreach (Point point in this.OffenceArea.Area)
     {
         Architecture architectureByPosition = base.Scenario.GetArchitectureByPosition(point);
         if (architectureByPosition != null)
         {
             if ((architectureByPosition.Endurance == 0) || this.IsFriendly(architectureByPosition.BelongedFaction))
             {
                 continue;
             }
             if (this.IfAttackArchitecture(architectureByPosition, last))
             {
                 list.Add(architectureByPosition);
             }
         }
     }
     return list;
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:20,代码来源:Troop.cs


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