本文整理汇总了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;未经允许,请勿转载。 |
请发表评论