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


C# Planet.PlanetId方法代码示例

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


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

示例1: MuteerMijnPlaneet

    internal List<Planet> MuteerMijnPlaneet(Planet myPlanet, int strength)
    {
        int index = MijnPlaneten.FindIndex(c => c.PlanetId() == myPlanet.PlanetId());

        MijnPlaneten[index].Sterkte -= strength;
        return MijnPlaneten;
    }
开发者ID:RachelleJanssen,项目名称:uninformed-bot,代码行数:7,代码来源:mapstate.cs

示例2: MuteerDoelPlaneten

    internal List<Planet> MuteerDoelPlaneten(Planet target)
    {
        int index = NietMijnPlaneten.FindIndex(c => c.PlanetId() == target.PlanetId());
        NietMijnPlaneten[index].Owner(1);

        return NietMijnPlaneten;
    }
开发者ID:RachelleJanssen,项目名称:uninformed-bot,代码行数:7,代码来源:mapstate.cs

示例3: IssueOrder

 // Sends an order to the game engine. An order is composed of a source
 // planet number, a destination planet number, and a number of ships. A
 // few things to keep in mind:
 //   * you can issue many orders per turn if you like.
 //   * the planets are numbered starting at zero, not one.
 //   * you must own the source planet. If you break this rule, the game
 //     engine kicks your bot out of the game instantly.
 //   * you can't move more ships than are currently on the source planet.
 //   * the ships will take a few turns to reach their destination. Travel
 //     is not instant. See the Distance() function for more info.
 public void IssueOrder(Planet source, Planet dest, int numShips)
 {
     Console.WriteLine("" + source.PlanetId() + " " + dest.PlanetId() +
                       " " + numShips);
     Console.Out.Flush();
 }
开发者ID:RachelleJanssen,项目名称:uninformed-bot,代码行数:16,代码来源:PlanetWars.cs


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