Beispiel #1
0
  private static MinedCounter runStrategy(
      BlockMap blockMap, int mineLength, List<Vector> starts, int branchOffset, int branches) {
    MinedCounter mined = new MinedCounter();

    for (Vector start : starts) {
      Miner miner = new Miner(blockMap.clone());

      for (int x = 0; x < branches; x++) {
        Vector currentStart =
            new Vector(start.getX() + x * branchOffset, start.getY(), start.getZ());

        miner.run(currentStart, new Point(0, 1), mineLength);
      }

      //            System.out.println(String.format("Iteration %d", i + 1));
      //            System.out.println(miner.getMined());

      mined.addAll(miner.getMined());
    }

    mined.average(starts.size());

    return mined;
  }