本文整理汇总了C#中Battle.AddMission方法的典型用法代码示例。如果您正苦于以下问题:C# Battle.AddMission方法的具体用法?C# Battle.AddMission怎么用?C# Battle.AddMission使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Battle
的用法示例。
在下文中一共展示了Battle.AddMission方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetStoryBattle
/// <summary>
/// Sets the story battle: mission and world resources. Players must be set separately.
/// </summary>
private void SetStoryBattle()
{
game = new Battle();
game.SetWorldResources(5000, 5000, 5000);
Battle.MissionDefinition.TargetType t = new Battle.MissionDefinition.TargetType();
t.building = BuildingTypes.STRONGHOLD;
game.AddMission(Battle.MissionType.DESTROY, 1, EntityType.BUILDING, t, 0, true, "");
}
示例2: hardcodedBattle
/// <summary>
/// Sets the battle with predefined parameters for the mission, player
/// settings, and resources.
/// </summary>
private void hardcodedBattle()
{
game = new Battle();
// Sets the mission
Battle.MissionDefinition.TargetType t = new Battle.MissionDefinition.TargetType();
t.unit = UnitTypes.HERO;
game.AddMission(Battle.MissionType.DESTROY, 1, EntityType.UNIT, t, 0, true, "");
// Initializes the human civilization
Battle.PlayerInformation player = new Battle.PlayerInformation(Races.MEN);
player.AddBuilding(BuildingTypes.STRONGHOLD, 752, 880, EntityStatus.IDLE);
player.AddUnit(UnitTypes.HERO, 764.9564f, 823.0175f);
player.SetInitialResources(2000, 2000, 2000, 2000);
game.AddPlayerInformation(player);
// Initializes the elven civilization
player = new Battle.PlayerInformation(Races.ELVES);
player.AddUnit(UnitTypes.HERO, 331.35f, 575.81f);
player.AddBuilding(BuildingTypes.STRONGHOLD, 283.7f, 562.5f, EntityStatus.IDLE);
player.SetInitialResources(2000, 2000, 2000, 2000);
game.AddPlayerInformation(player);
game.SetWorldResources(5000, 5000, 5000);
}