• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# GameObjects.ArchitectureList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ArchitectureList类属于GameObjects命名空间,在下文中一共展示了ArchitectureList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: LoadArchitecturesFromString

 public List<string> LoadArchitecturesFromString(ArchitectureList architectures, string dataString)
 {
     List<string> errorMsg = new List<string>();
     char[] separator = new char[] { ' ', '\n', '\r', '\t' };
     string[] strArray = dataString.Split(separator, StringSplitOptions.RemoveEmptyEntries);
     this.Architectures.Clear();
     try
     {
         foreach (string str in strArray)
         {
             Architecture gameObject = architectures.GetGameObject(int.Parse(str)) as Architecture;
             if (gameObject != null)
             {
                 this.AddArchitecture(gameObject);
             }
             else
             {
                 errorMsg.Add("建筑ID" + str + "不存在");
             }
         }
     }
     catch
     {
         errorMsg.Add("建筑列表应为半型空格分隔的建筑ID");
     }
     if (this.ArchitectureCount == 0)
     {
         errorMsg.Add("没有建筑");
     }
     return errorMsg;
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:31,代码来源:Section.cs


示例3: ShowOrientationFrame

        private void ShowOrientationFrame()
        {
            GameDelegates.VoidFunction function = null;
            GameDelegates.VoidFunction function2 = null;
            GameDelegates.VoidFunction function3 = null;
            switch (this.EditingSection.AIDetail.OrientationKind)
            {
                case SectionOrientationKind.军区:
                    this.TabListPlugin.InitialValues(this.EditingFaction.GetOtherSections(this.OriginalSection), null, this.screen.MouseState.ScrollWheelValue, "");
                    this.TabListPlugin.SetListKindByName("Section", true, false);
                    this.TabListPlugin.SetSelectedTab("");
                    this.GameFramePlugin.Kind = FrameKind.TerrainDetail;
                    this.GameFramePlugin.Function = FrameFunction.Transport;
                    this.GameFramePlugin.SetFrameContent(this.TabListPlugin.TabList, this.screen.viewportSize);
                    this.GameFramePlugin.OKButtonEnabled = false;
                    this.GameFramePlugin.CancelButtonEnabled = true;
                    if (function == null)
                    {
                        function = delegate {
                            this.EditingSection.OrientationFaction = null;
                            this.EditingSection.OrientationState = null;
                            this.EditingSection.OrientationArchitecture = null;
                            this.EditingSection.OrientationSection = this.TabListPlugin.SelectedItem as Section;
                            this.RefreshOKButton();
                            this.RefreshLabelTextsDisplay();
                        };
                    }
                    this.GameFramePlugin.SetOKFunction(function);
                    break;

                case SectionOrientationKind.势力:
                    this.TabListPlugin.InitialValues(this.EditingFaction.Scenario.DiplomaticRelations.GetDiplomaticRelationDisplayListByFactionID(this.EditingFaction.ID).GetList(), null, this.screen.MouseState.ScrollWheelValue, "");
                    this.TabListPlugin.SetListKindByName("DiplomaticRelation", true, false);
                    this.TabListPlugin.SetSelectedTab("");
                    this.GameFramePlugin.Kind = FrameKind.CastTargetKind;
                    this.GameFramePlugin.Function = FrameFunction.GetSectionToDemolish;
                    this.GameFramePlugin.SetFrameContent(this.TabListPlugin.TabList, this.screen.viewportSize);
                    this.GameFramePlugin.OKButtonEnabled = false;
                    this.GameFramePlugin.CancelButtonEnabled = true;
                    if (function2 == null)
                    {
                        function2 = delegate {
                            this.EditingSection.OrientationSection = null;
                            this.EditingSection.OrientationState = null;
                            this.EditingSection.OrientationArchitecture = null;
                            DiplomaticRelationDisplay selectedItem = this.TabListPlugin.SelectedItem as DiplomaticRelationDisplay;
                            if (selectedItem.LinkedFaction1 == this.EditingFaction)
                            {
                                this.EditingSection.OrientationFaction = selectedItem.LinkedFaction2;
                            }
                            else if (selectedItem.LinkedFaction2 == this.EditingFaction)
                            {
                                this.EditingSection.OrientationFaction = selectedItem.LinkedFaction1;
                            }
                            this.RefreshOKButton();
                            this.RefreshLabelTextsDisplay();
                        };
                    }
                    this.GameFramePlugin.SetOKFunction(function2);
                    break;

                case SectionOrientationKind.州域:
                    this.TabListPlugin.InitialValues(this.EditingFaction.Scenario.States.GetList(), null, this.screen.MouseState.ScrollWheelValue, "");
                    this.TabListPlugin.SetListKindByName("State", true, false);
                    this.TabListPlugin.SetSelectedTab("");
                    this.GameFramePlugin.Kind = FrameKind.SectionAIDetail;
                    this.GameFramePlugin.Function = FrameFunction.GetFaction;
                    this.GameFramePlugin.SetFrameContent(this.TabListPlugin.TabList, this.screen.viewportSize);
                    this.GameFramePlugin.OKButtonEnabled = false;
                    this.GameFramePlugin.CancelButtonEnabled = true;
                    if (function3 == null)
                    {
                        function3 = delegate {
                            this.EditingSection.OrientationFaction = null;
                            this.EditingSection.OrientationSection = null;
                            this.EditingSection.OrientationState = this.TabListPlugin.SelectedItem as State;
                            this.EditingSection.OrientationArchitecture = null;
                            this.RefreshOKButton();
                            this.RefreshLabelTextsDisplay();
                        };
                    }
                    this.GameFramePlugin.SetOKFunction(function3);
                    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);
                        }
                    }
                    this.TabListPlugin.InitialValues(targetArch, null, this.screen.MouseState.ScrollWheelValue, "");
                    this.TabListPlugin.SetListKindByName("Architecture", true, false);
                    this.TabListPlugin.SetSelectedTab("");
                    this.GameFramePlugin.Kind = FrameKind.Architecture;
                    this.GameFramePlugin.Function = FrameFunction.GetFaction;
                    this.GameFramePlugin.SetFrameContent(this.TabListPlugin.TabList, this.screen.viewportSize);
//.........这里部分代码省略.........
开发者ID:simon217,项目名称:ZhongHuaSanGuoZhi,代码行数:101,代码来源:MarshalSectionDialog.cs


示例4: 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


示例5: 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


示例6: FindLinks

 public void FindLinks(ArchitectureList allArch)
 {
     pathFinder.OnGetCost += new RoutewayPathFinder.GetCost(RoutewayPathBuilder_OnGetCost);
     pathFinder.OnGetPenalizedCost += new RoutewayPathFinder.GetPenalizedCost(RoutewayPathBuilder_OnGetPenalizedCost);
     FindLandLinks(allArch, 50);
     FindWaterLinks(allArch, 50);
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:7,代码来源:Architecture.cs


示例7: QuickSortSwapArchitectureDistance

 private void QuickSortSwapArchitectureDistance(ArchitectureList List, int i, int j)
 {
     GameObject obj2 = List[i];
     List[i] = List[j];
     List[j] = obj2;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:6,代码来源:Architecture.cs


示例8: 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


示例9: 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


示例10: 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


示例11: 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


示例12: generatePerson

        private void generatePerson()
        {
            this.scen.GameCommonData.PersonGeneratorSetting.bornLo = int.Parse(tbBornYearLo.Text);
            this.scen.GameCommonData.PersonGeneratorSetting.bornHi = int.Parse(tbBornYearHi.Text);
            this.scen.GameCommonData.PersonGeneratorSetting.debutLo = int.Parse(tbDebutAgeLo.Text);
            this.scen.GameCommonData.PersonGeneratorSetting.debutHi = int.Parse(tbDebutAgeHi.Text);
            this.scen.GameCommonData.PersonGeneratorSetting.dieLo = int.Parse(tbAgeLo.Text);
            this.scen.GameCommonData.PersonGeneratorSetting.dieHi = int.Parse(tbAgeHi.Text);
            this.scen.GameCommonData.PersonGeneratorSetting.debutAtLeast = int.Parse(tbDebutAtLeast.Text);

            ((PersonGeneratorType)this.scen.GameCommonData.AllPersonGeneratorTypes.GameObjects[0]).generationChance = int.Parse(tbPersonType0.Text);
            ((PersonGeneratorType)this.scen.GameCommonData.AllPersonGeneratorTypes.GameObjects[1]).generationChance = int.Parse(tbPersonType1.Text);
            ((PersonGeneratorType)this.scen.GameCommonData.AllPersonGeneratorTypes.GameObjects[2]).generationChance = int.Parse(tbPersonType2.Text);
            ((PersonGeneratorType)this.scen.GameCommonData.AllPersonGeneratorTypes.GameObjects[3]).generationChance = int.Parse(tbPersonType3.Text);
            ((PersonGeneratorType)this.scen.GameCommonData.AllPersonGeneratorTypes.GameObjects[4]).generationChance = int.Parse(tbPersonType4.Text);
            ((PersonGeneratorType)this.scen.GameCommonData.AllPersonGeneratorTypes.GameObjects[5]).generationChance = int.Parse(tbPersonType5.Text);
            ((PersonGeneratorType)this.scen.GameCommonData.AllPersonGeneratorTypes.GameObjects[6]).generationChance = int.Parse(tbPersonType6.Text);
            ((PersonGeneratorType)this.scen.GameCommonData.AllPersonGeneratorTypes.GameObjects[7]).generationChance = int.Parse(tbPersonType7.Text);
            ((PersonGeneratorType)this.scen.GameCommonData.AllPersonGeneratorTypes.GameObjects[8]).generationChance = int.Parse(tbPersonType8.Text);
            ((PersonGeneratorType)this.scen.GameCommonData.AllPersonGeneratorTypes.GameObjects[9]).generationChance = int.Parse(tbPersonType9.Text);

            int count = GameObject.Random(int.Parse(tbAddPersonLo.Text), int.Parse(tbAddPersonHi.Text));

            int joinChance = int.Parse(tbJoinedFactionChance.Text);
            for (int i = 0; i < count; ++i)
            {
                bool joined = GameObject.Chance(joinChance);

                Architecture location = null;
                if (joined)
                {
                    ArchitectureList candidates = new ArchitectureList();
                    foreach (Architecture j in scen.Architectures)
                    {
                        if (j.BelongedFaction != null)
                        {
                            candidates.Add(j);
                        }
                    }
                    if (candidates.Count > 0)
                    {
                        location = (Architecture)candidates.GetRandomObject();
                    }
                    else
                    {
                        joined = false;
                    }
                }

                if (!joined)
                {
                    location = (Architecture)scen.Architectures.GetRandomObject();
                }

                Person p = Person.createPerson(scen, location, null, false);
                if (joined && location.BelongedFaction != null)
                {
                    p.ChangeFaction(location.BelongedFaction);
                }
            }
        }
开发者ID:kpxp,项目名称:ZhongHuaSanGuoZhi-New-Code,代码行数:61,代码来源:Form1.cs


示例13: QuickSortArchitecturesDistance

 private void QuickSortArchitecturesDistance(ArchitectureList List, int begin, int end)
 {
     if (begin < end)
     {
         int num = this.QuickSortPartitionArchitecturesDistance(List, begin, end);
         if (begin < (num - 1))
         {
             this.QuickSortArchitecturesDistance(List, begin, num - 1);
         }
         if ((num + 1) < end)
         {
             this.QuickSortArchitecturesDistance(List, num + 1, end);
         }
     }
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:15,代码来源:Architecture.cs


示例14: 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


示例15: QuickSortPartitionArchitecturesDistance

 private int QuickSortPartitionArchitecturesDistance(ArchitectureList List, int begin, int end)
 {
     Architecture architecture = List[begin] as Architecture;
     int simpleDistance = base.Scenario.GetSimpleDistance(architecture.Position, this.Position);
     int num2 = begin;
     while (begin < end)
     {
         int num3 = base.Scenario.GetSimpleDistance((List[end] as Architecture).Position, this.Position);
         while ((begin < end) && (num3 >= simpleDistance))
         {
             end--;
             num3 = base.Scenario.GetSimpleDistance((List[end] as Architecture).Position, this.Position);
         }
         if (begin >= end)
         {
             return begin;
         }
         this.QuickSortSwapArchitectureDistance(List, begin, end);
         begin++;
         for (num3 = base.Scenario.GetSimpleDistance((List[begin] as Architecture).Position, this.Position); (begin < end) && (num3 <= simpleDistance); num3 = base.Scenario.GetSimpleDistance((List[begin] as Architecture).Position, this.Position))
         {
             begin++;
         }
         if (begin >= end)
         {
             return begin;
         }
         this.QuickSortSwapArchitectureDistance(List, begin, end);
         end--;
     }
     return begin;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:32,代码来源:Architecture.cs


示例16: 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


示例17: 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


示例18: 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


示例19: 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))))
                             {
                                 first 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# GameObjects.Event类代码示例发布时间:2022-05-26
下一篇:
C# GameObjects.Architecture类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap