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

        MijnPlaneten[index].Sterkte -= strength;
        return MijnPlaneten;
    }
Ejemplo n.º 2
0
    internal List<Planet> MuteerDoelPlaneten(Planet target)
    {
        int index = NietMijnPlaneten.FindIndex(c => c.PlanetId() == target.PlanetId());
        NietMijnPlaneten[index].Owner(1);

        return NietMijnPlaneten;
    }
Ejemplo n.º 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)
 {
     Console.WriteLine("" + source.PlanetId() + " " + dest.PlanetId() +
                       " " + numShips);
     Console.Out.Flush();
 }