本文整理汇总了C#中GameObjects.Military类的典型用法代码示例。如果您正苦于以下问题:C# Military类的具体用法?C# Military怎么用?C# Military使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Military类属于GameObjects命名空间,在下文中一共展示了Military类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
}
示例4: RemoveMilitary
public void RemoveMilitary(Military military)
{
this.Militaries.Remove(military);
military.StopRecruitment();
military.BelongedArchitecture = null;
}
示例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 });
}
}
示例6: IsMilitaryUnavailable
public bool IsMilitaryUnavailable(Military military)
{
return (military.BelongedArchitecture == null);
}
示例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;
}
示例8: CreateTroop
public Troop CreateTroop(GameObjectList persons, Person leader, Military military, int food, Point position)
{
return Troop.Create(this, persons, leader, military, food, position);
}
示例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;
}
示例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, "补充", "补充");
}
}
示例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, "选择编队", "");
}
}
示例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, "编队升级", "编队升级");
}
}
}
示例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;
}
示例14: SetArmy
public void SetArmy(Military m)
{
this.army = m;
}
示例15: AddMilitary
public void AddMilitary(Military military)
{
this.Militaries.AddMilitary(military);
military.BelongedArchitecture = this;
}