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


C# PersonList.Clear方法代码示例

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


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

示例1: ReSortAllWeighingList

 private void ReSortAllWeighingList(PersonList zhenzaiPersons, PersonList agriculturePersons, PersonList commercePersons,
     PersonList technologyPersons, PersonList dominationPersons, PersonList moralePersons, PersonList endurancePersons,
     PersonList recruitmentPersons, PersonList trainingPersons, MilitaryList weighingMilitaries)
 {
     PersonList pl = this.Persons;
     zhenzaiPersons.Clear();
     if (this.kezhenzai())
     {
         foreach (Person person in pl)
         {
             zhenzaiPersons.Add(person);
         }
         zhenzaiPersons.IsNumber = true;
         zhenzaiPersons.PropertyName = "zhenzaiWeighing";
         zhenzaiPersons.ReSort();
     }
     agriculturePersons.Clear();
     if (this.Kind.HasAgriculture)
     {
         foreach (Person person in pl)
         {
             agriculturePersons.Add(person);
         }
         agriculturePersons.IsNumber = true;
         agriculturePersons.PropertyName = "AgricultureWeighing";
         agriculturePersons.ReSort();
     }
     commercePersons.Clear();
     if (this.Kind.HasCommerce)
     {
         foreach (Person person in pl)
         {
             commercePersons.Add(person);
         }
         commercePersons.IsNumber = true;
         commercePersons.PropertyName = "CommerceWeighing";
         commercePersons.ReSort();
     }
     technologyPersons.Clear();
     if (this.Kind.HasTechnology)
     {
         foreach (Person person in pl)
         {
             technologyPersons.Add(person);
         }
         technologyPersons.IsNumber = true;
         technologyPersons.PropertyName = "TechnologyWeighing";
         technologyPersons.ReSort();
     }
     dominationPersons.Clear();
     if (this.Kind.HasDomination)
     {
         foreach (Person person in pl)
         {
             dominationPersons.Add(person);
         }
         dominationPersons.IsNumber = true;
         dominationPersons.PropertyName = "DominationWeighing";
         dominationPersons.ReSort();
     }
     moralePersons.Clear();
     if (this.Kind.HasMorale)
     {
         foreach (Person person in pl)
         {
             moralePersons.Add(person);
         }
         moralePersons.IsNumber = true;
         moralePersons.PropertyName = "MoraleWeighing";
         moralePersons.ReSort();
     }
     endurancePersons.Clear();
     if (this.Kind.HasEndurance)
     {
         foreach (Person person in pl)
         {
             endurancePersons.Add(person);
         }
         endurancePersons.IsNumber = true;
         endurancePersons.PropertyName = "EnduranceWeighing";
         endurancePersons.ReSort();
     }
     trainingPersons.Clear();
     foreach (Person person in pl)
     {
         trainingPersons.Add(person);
     }
     trainingPersons.IsNumber = true;
     trainingPersons.PropertyName = "TrainingWeighing";
     trainingPersons.ReSort();
     recruitmentPersons.Clear();
     foreach (Person person in this.Persons)
     {
         recruitmentPersons.Add(person);
     }
     recruitmentPersons.IsNumber = true;
     recruitmentPersons.PropertyName = "RecruitmentWeighing";
     recruitmentPersons.ReSort();
     weighingMilitaries.Clear();
     foreach (Military military in this.Militaries)
//.........这里部分代码省略.........
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:101,代码来源:Architecture.cs

示例2: BuildTransportTroop

 private Troop BuildTransportTroop(Architecture destination, Military military, int food, int fund)
 {
     Troop troop;
     int min = int.MaxValue;
     PersonList leader = new PersonList();
     foreach (Person p in this.Persons)
     {
         if (p.Merit < min)
         {
             leader.Clear();
             leader.Add(p);
             min = p.Merit;
         }
     }
     if (leader.Count <= 0) return null;
     troop = Troop.CreateSimulateTroop(leader, military, this.Position);
     Point? nullable = this.GetRandomStartingPosition(troop);
     if (!nullable.HasValue)
     {
         return null;
     }
     troop.Destroy(true, false);
     troop = this.CreateTroop(leader, leader[0] as Person, military, food, nullable.Value);
     troop.WillArchitecture = destination;
     troop.zijin = fund;
     this.Fund -= fund;
     Legion legion = this.BelongedFaction.GetLegion(destination);
     if (legion == null)
     {
         legion = this.CreateOffensiveLegion(destination);
     }
     legion.AddTroop(troop);
     this.PostCreateTroop(troop, false);
     return troop;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:35,代码来源:Architecture.cs

示例3: ClearWork

        private void ClearWork()
        {
            PersonList renwuliebiao = new PersonList();

            if (this.Agriculture >= this.AgricultureCeiling)
            {

                foreach (Person person in this.AgricultureWorkingPersons)
                {
                    renwuliebiao.Add(person);
                }
                foreach (Person person in renwuliebiao)
                {
                    this.RemovePersonFromWorkingList(person);
                }
                renwuliebiao.Clear();
            }
            if (this.Commerce >= this.CommerceCeiling)
            {
                foreach (Person person in this.CommerceWorkingPersons)
                {
                    renwuliebiao.Add(person);
                }

                foreach (Person person in renwuliebiao )
                {
                    this.RemovePersonFromWorkingList(person);
                }
                renwuliebiao.Clear();
            }
            if (this.Technology >= this.TechnologyCeiling)
            {
                foreach (Person person in this.TechnologyWorkingPersons)
                {
                    renwuliebiao.Add(person);
                }
                foreach (Person person in renwuliebiao)
                {
                    this.RemovePersonFromWorkingList(person);
                }
                renwuliebiao.Clear();
            }
            /*        统治到顶时不停止工作
            if (this.Domination >= this.DominationCeiling)
            {
                foreach (Person person in this.DominationWorkingPersons)
                {
                    this.RemovePersonFromWorkingList(person);
                }
            }
            */
            if (this.Morale >= this.MoraleCeiling)
            {
                foreach (Person person in this.MoraleWorkingPersons)
                {
                    renwuliebiao.Add(person);
                }
                foreach (Person person in renwuliebiao)
                {
                    this.RemovePersonFromWorkingList(person);
                }
                renwuliebiao.Clear();
            }
            if (this.Endurance >= this.EnduranceCeiling)
            {
                foreach (Person person in this.EnduranceWorkingPersons)
                {
                    renwuliebiao.Add(person);
                }
                foreach (Person person in renwuliebiao)
                {
                    this.RemovePersonFromWorkingList(person);
                }
                renwuliebiao.Clear();
            }
            
            foreach (Military military in this.Militaries)
            {
                if ((military.Morale >= military.MoraleCeiling) && (military.Combativity >= military.CombativityCeiling))
                {
                    military.StopTraining();
                    
                }
                if (military.Quantity >= military.Kind.MaxScale)
                {
                    military.StopRecruitment();
                    
                }
            }
        }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:90,代码来源:Architecture_1.cs

示例4: tingzhizhenzai

        private void tingzhizhenzai()
        {
            PersonList renwuliebiao = new PersonList();

            foreach (Person person in this.zhenzaiWorkingPersons)
            {
                renwuliebiao.Add(person);
            }
            foreach (Person person in renwuliebiao)
            {
                this.RemovePersonFromWorkingList(person);
            }
            renwuliebiao.Clear();
        }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:14,代码来源:Architecture_1.cs

示例5: ChangeLeaderAfterLeaderDeath

 public Faction ChangeLeaderAfterLeaderDeath()
 {
     Person leader = this.Leader;
     Architecture locationArchitecture = this.Leader.LocationArchitecture;
     this.Leader.Status = GameObjects.PersonDetail.PersonStatus.None;
     this.Leader.Available = false;
     //base.Scenario.Persons.Remove(this.Leader);
     base.Scenario.AvailablePersons.Remove(this.Leader);
     Person person2 = null;
     PersonList list = new PersonList();
     if (person2 == null)
     {
         foreach (Person person3 in this.Persons)
         {
             if ((person3.Father >= 0) && (person3.Sex == this.Leader.Sex) && ((this.Leader.Father == person3.Father) || (person3.Father == this.Leader.ID)))
             {
                 list.Add(person3);
             }
         }
         if (list.Count > 0)
         {
             if (list.Count > 1)
             {
                 list.PropertyName = "YearBorn";
                 list.IsNumber = true;
                 list.SmallToBig = true;
                 list.ReSort();
             }
             person2 = list[0] as Person;
         }
     }
     if (person2 == null)
     {
         list.Clear();
         foreach (Person person3 in this.Persons)
         {
             if ((person3.Strain >= 0) && (person3.Sex == this.Leader.Sex) && (this.Leader.Strain == person3.Strain))
             {
                 list.Add(person3);
             }
         }
         if (list.Count > 0)
         {
             if (list.Count > 1)
             {
                 list.PropertyName = "YearBorn";
                 list.IsNumber = true;
                 list.SmallToBig = true;
                 list.ReSort();
             }
             person2 = list[0] as Person;
         }
     }
     if (person2 == null)
     {
         list.Clear();
         foreach (Person person3 in this.Persons)
         {
             if ((person3.Brother >= 0) && (person3.Sex == this.Leader.Sex) && (this.Leader.Brother == person3.Brother))
             {
                 list.Add(person3);
             }
         }
         if (list.Count > 0)
         {
             if (list.Count > 1)
             {
                 list.PropertyName = "Glamour";
                 list.IsNumber = true;
                 list.ReSort();
             }
             person2 = list[0] as Person;
         }
     }
     if (person2 == null)
     {
         foreach (Person person3 in this.Persons)
         {
             if ((person3.Mother >= 0) && (person3.Sex == this.Leader.Sex) && ((this.Leader.Mother == person3.Mother) || (person3.Mother == this.Leader.ID)))
             {
                 list.Add(person3);
             }
         }
         if (list.Count > 0)
         {
             if (list.Count > 1)
             {
                 list.PropertyName = "YearBorn";
                 list.IsNumber = true;
                 list.SmallToBig = true;
                 list.ReSort();
             }
             person2 = list[0] as Person;
         }
     }
     if (GlobalVariables.PermitFactionMerge)
     {
         Faction maxFriendlyDiplomaticRelation = this.MaxFriendlyDiplomaticRelation;
         if (maxFriendlyDiplomaticRelation != null)
         {
//.........这里部分代码省略.........
开发者ID:kanjianlema,项目名称:ZhongHuaSanGuoZhi,代码行数:101,代码来源:Faction.cs


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