コード例 #1
0
ファイル: Game.cs プロジェクト: Unexpected/dtstrike
 // 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)
 {
     System.Console.Out.Write("" + source.id + " " + dest.id + " " + numShips + "\n");
     System.Console.Out.Flush();
 }
コード例 #2
0
ファイル: Game.cs プロジェクト: Unexpected/dtstrike
 public MilitaryPlanet findClosestMilitaryPlanet(Planet sourcePlanet)
 {
     return findClosestMilitaryPlanet(sourcePlanet.id);
 }
コード例 #3
0
 // 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)
 {
     System.Console.Out.Write("" + source.id + " " + dest.id + " " + numShips + "\n");
     System.Console.Out.Flush();
 }