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

C# GameObjects.Military类代码示例

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

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



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

示例1: Create

 public static Military Create(GameScenario scenario, Architecture architecture, MilitaryKind kind)
 {
     Military military = new Military();
     military.Scenario = scenario;
     military.KindID = kind.ID;
     military.ID = scenario.Militaries.GetFreeGameObjectID();
     if (kind.RecruitLimit == 1)
     {
         military.Name = kind.Name;
     }
     else
     {
         military.Name = kind.Name + "队";
     }
     architecture.AddMilitary(military);
     architecture.BelongedFaction.AddMilitary(military);
     scenario.Militaries.AddMilitary(military);
     architecture.DecreaseFund((int) (kind.CreateCost * kind.GetRateOfNewMilitary(architecture)));
     if (kind.IsTransport)
     {
         military.Quantity = kind.MaxScale;
         military.Morale = military.MoraleCeiling;
         military.Combativity = military.CombativityCeiling;
     }
     return military;
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:26,代码来源:Military.cs


示例2: CreateSimulateTroop

 public static Troop CreateSimulateTroop(GameObjectList persons, Military military, Point startPosition)
 {
     Troop troop = new Troop();
     troop.Scenario = military.Scenario;
     troop.Simulating = true;
     if (persons != null)
     {
         foreach (Person person in persons)
         {
             troop.AddPerson(person);
         }
         troop.SetLeader(persons[0] as Person);
         troop.BackupArmyLeaderID = (military.Leader != null) ? military.Leader.ID : -1;
         troop.BackupArmyLeaderExperience = military.LeaderExperience;
         troop.BackupArmyLeader = military.Leader;
         troop.Army = military;
         troop.SimulateInitializePosition(startPosition);
         foreach (Person person in persons)
         {
             person.LocationTroop = null;
         }
     }
     troop.Simulating = false;
     military.Leader = troop.BackupArmyLeader;
     military.LeaderExperience = troop.BackupArmyLeaderExperience;
     military.LeaderID = troop.BackupArmyLeaderID;
     return troop;
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:28,代码来源:Troop.cs


示例3: AddMessageToTodayNewMilitarySpyMessage

 private void AddMessageToTodayNewMilitarySpyMessage(Military m)
 {
     if (this.TodayNewMilitarySpyMessage == null)
     {
         this.TodayNewMilitarySpyMessage = this.CreateNewMilitarySpyMessage(m);
     }
     else
     {
         this.TodayNewMilitarySpyMessage.Message3 = this.TodayNewMilitarySpyMessage.Message3 + "," + m.Name;
     }
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:11,代码来源:Architecture.cs


示例4: RemoveMilitary

 public void RemoveMilitary(Military military)
 {
     this.Militaries.Remove(military);
     military.StopRecruitment();
     military.BelongedArchitecture = null;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:6,代码来源:Architecture.cs


示例5: LevelUpMilitary

 public void LevelUpMilitary(Military m)
 {
     MilitaryKind militaryKind = base.Scenario.GameCommonData.AllMilitaryKinds.GetMilitaryKind(m.Kind.LevelUpKindID);
     if ((militaryKind != null) && (!m.BelongedFaction.IsMilitaryKindOverLimit(militaryKind.ID)))
     {
         int num = (m.Quantity * militaryKind.MinScale) / m.Kind.MinScale;
         int num2 = ((m.Experience - m.Kind.LevelUpExperience) * militaryKind.MinScale) / m.Kind.MinScale;
         this.IncreasePopulation(m.Quantity - num);
         m.Kind = militaryKind;
         m.Quantity = num;
         m.Experience = num2;
         m.Name = m.Kind.Name + "队";
         ExtensionInterface.call("LevelUpMilitary", new Object[] { this.Scenario, this, m });
     }
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:15,代码来源:Architecture.cs


示例6: IsMilitaryUnavailable

 public bool IsMilitaryUnavailable(Military military)
 {
     return (military.BelongedArchitecture == null);
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:4,代码来源:Architecture.cs


示例7: GetBeMergedMilitaryList

 public MilitaryList GetBeMergedMilitaryList(Military military)
 {
     this.BeMergedMilitaryList.Clear();
     foreach (Military military2 in this.MergeMilitaryList)
     {
         if ((military2 != military) && (military2.Kind == military.Kind))
         {
             this.BeMergedMilitaryList.Add(military2);
         }
     }
     return this.BeMergedMilitaryList;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:12,代码来源:Architecture.cs


示例8: CreateTroop

 public Troop CreateTroop(GameObjectList persons, Person leader, Military military, int food, Point position)
 {
     return Troop.Create(this, persons, leader, military, food, position);
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:4,代码来源:Architecture.cs


示例9: SimCreate

 public static Military SimCreate(GameScenario scenario, Architecture architecture, MilitaryKind kind)
 {
     Military military = new Military();
     military.Scenario = scenario;
     military.KindID = kind.ID;
     military.ID = scenario.Militaries.GetFreeGameObjectID();
     if (kind.RecruitLimit == 1)
     {
         military.Name = kind.Name;
         return military;
     }
     military.Name = kind.Name + "队";
     return military;
 }
开发者ID:kpxp,项目名称:ZhongHuaSanGuoZhi-New-Code,代码行数:14,代码来源:Military.cs


示例10: FrameFunction_Architecture_AfterGetRecruitmentMilitary

 // 补充
 private void FrameFunction_Architecture_AfterGetRecruitmentMilitary()
 {
     GameObjectList selectedList = this.CurrentArchitecture.RecruitmentMilitaryList.GetSelectedList();
     if ((selectedList != null) && (selectedList.Count == 1))
     {
         this.CurrentMilitary = selectedList[0] as Military;
         this.mainGameScreen.ShowTabListInFrame(UndoneWorkKind.Frame, FrameKind.Work, FrameFunction.GetRecruitmentPerson, false, true, true, false, this.CurrentArchitecture.Persons, null, "补充", "补充");
     }
 }
开发者ID:kpxp,项目名称:ZhongHuaSanGuoZhi-New-Code,代码行数:10,代码来源:ScreenManager.cs


示例11: FrameFunction_Architecture_AfterGetMergeMilitary

 private void FrameFunction_Architecture_AfterGetMergeMilitary()
 {
     GameObjectList selectedList = this.CurrentArchitecture.MergeMilitaryList.GetSelectedList();
     if ((selectedList != null) && (selectedList.Count == 1))
     {
         this.CurrentMilitary = selectedList[0] as Military;
         this.mainGameScreen.ShowTabListInFrame(UndoneWorkKind.Frame, FrameKind.Military, FrameFunction.GetBeMergedMilitaries, false, true, true, false, this.CurrentArchitecture.GetBeMergedMilitaryList(this.CurrentMilitary), null, "选择编队", "");
     }
 }
开发者ID:kpxp,项目名称:ZhongHuaSanGuoZhi-New-Code,代码行数:9,代码来源:ScreenManager.cs


示例12: FrameFunction_Architecture_AfterGetLevelUpMilitaries

 private void FrameFunction_Architecture_AfterGetLevelUpMilitaries()
 {
     if (this.CurrentArchitecture != null)
     {
         this.CurrentGameObjects = this.CurrentArchitecture.LevelUpMilitaryList.GetSelectedList();
         if ((this.CurrentGameObjects != null) && (this.CurrentGameObjects.Count == 1))
         {
             this.CurrentMilitary = (Military) this.CurrentGameObjects[0];
             this.mainGameScreen.ShowTabListInFrame(UndoneWorkKind.Frame, FrameKind.MilitaryKind, FrameFunction.GetLevelUpMiliaryKind, true, true, true, false, this.CurrentArchitecture.GetUpgradableMilitaryKindList(this.CurrentMilitary), null, "编队升级", "编队升级");
         }
     }
 }
开发者ID:kpxp,项目名称:ZhongHuaSanGuoZhi-New-Code,代码行数:12,代码来源:ScreenManager.cs


示例13: AISelectPersonIntoTroop

 private TroopList AISelectPersonIntoTroop(Architecture from, Military military)
 {
     TroopList result = new TroopList();
     if ((military.FollowedLeader != null) && from.Persons.HasGameObject(military.FollowedLeader) && military.FollowedLeader.LocationTroop == null)
     {
         result.Add(Troop.CreateSimulateTroop(this.AISelectPersonIntoTroop_inner(military.FollowedLeader, from.Persons, true), military, from.Position));
     }
     else if ((((military.Leader != null) && (military.LeaderExperience >= 10)) && (((military.Leader.Strength >= 80) || (military.Leader.Command >= 80)) || military.Leader.HasLeaderValidCombatTitle))
         && from.Persons.HasGameObject(military.Leader) && military.Leader.LocationTroop == null)
     {
         result.Add(Troop.CreateSimulateTroop(this.AISelectPersonIntoTroop_inner(military.Leader, from.Persons, true), military, from.Position));
     }
     else
     {
         foreach (Person person in from.Persons)
         {
             if (!person.Selected)
             {
                 if ((this.BelongedFaction.AvailableMilitaryKinds.GetMilitaryKindList().GameObjects.Contains(military.Kind) && !military.Kind.Unique) ||
                     person.FightingForce >= Parameters.AIUniqueTroopFightingForceThreshold || this.Endurance < 30)
                 {
                     result.Add(Troop.CreateSimulateTroop(this.AISelectPersonIntoTroop_inner(person, from.Persons, false), military, from.Position));
                 }
             }
         }
     }
     return result;
 }
开发者ID:kanjianlema,项目名称:ZhongHuaSanGuoZhi,代码行数:28,代码来源:Architecture.cs


示例14: SetArmy

 public void SetArmy(Military m)
 {
     this.army = m;
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:4,代码来源:Troop.cs


示例15: AddMilitary

 public void AddMilitary(Military military)
 {
     this.Militaries.AddMilitary(military);
     military.BelongedArchitecture = this;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:5,代码来源:Architecture.cs


示例16: CreateRobberTroop

 public void CreateRobberTroop(Point position)
 {
     Military military = new Military();
     military.Scenario = base.Scenario;
     military.ID = base.Scenario.Militaries.GetFreeGameObjectID();
     base.Scenario.Militaries.AddMilitary(military);
     military.Kind = base.Scenario.GameCommonData.AllMilitaryKinds.GetMilitaryKind(0x15);
     military.Name = military.Kind.Name;
     military.Morale = military.MoraleCeiling;
     military.Combativity = military.CombativityCeiling;
     military.Quantity = (military.Kind.MinScale + (this.Population / 100)) * ((this.AreaCount / 2) + 2);
     if (military.Quantity > military.Kind.MaxScale)
     {
         military.Quantity = military.Kind.MaxScale;
     }
     GameObjectList persons = new GameObjectList();
     Person gameObject = base.Scenario.Persons.GetGameObject(0x1bc4) as Person;
     persons.Add(gameObject);
     Troop troop = this.CreateTroop(persons, gameObject, military, 0, position);
     troop.WillArchitecture = this;
     this.RobberTroop = troop;
     ExtensionInterface.call("CreateRobberTroop", new Object[] { this.Scenario, this, troop });
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:23,代码来源:Architecture.cs


示例17: SetShelledMilitary

 public void SetShelledMilitary(Military military)
 {
     if (this.ShelledMilitary != null)
     {
         this.ShelledMilitary.ShellingMilitary = null;
     }
     this.ShelledMilitary = military;
     if (military != null)
     {
         military.ShellingMilitary = this;
     }
 }
开发者ID:kpxp,项目名称:ZhongHuaSanGuoZhi-New-Code,代码行数:12,代码来源:Military.cs


示例18: DisbandMilitary

 public void DisbandMilitary(Military m)
 {
     if (!m.IsTransport)
     {
         this.IncreasePopulation(m.Quantity);
     }
     this.RemoveMilitary(m);
     this.BelongedFaction.RemoveMilitary(m);
     base.Scenario.Militaries.Remove(m);
     ExtensionInterface.call("DisbandMilitary", new Object[] { this.Scenario, this, m });
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:11,代码来源:Architecture.cs


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


示例20: GetMilitaryCampaignArea

 public GameArea GetMilitaryCampaignArea(Military military)
 {
     GameArea allAvailableArea = this.GetAllAvailableArea(false);
     military.ModifyAreaByTerrainAdaptablity(allAvailableArea);
     return allAvailableArea;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:6,代码来源:Architecture.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# GameObjects.Person类代码示例发布时间:2022-05-26
下一篇:
C# GameObjects.LinkNode类代码示例发布时间: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