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


C# Battle.AddPlayerInformation方法代码示例

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


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

示例1: 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);
    }
开发者ID:srferran,项目名称:ES2015A,代码行数:26,代码来源:GameInformation.cs


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