Package logisticspipes.routing

Examples of logisticspipes.routing.LogisticsPromise


   
    // Check the transaction and see if we have helped already
    int canProvide = getAvailableItemCount(tree.getStackItem());
    canProvide -= donePromisses;
    if (canProvide < 1) return;
    LogisticsPromise promise = new LogisticsPromise(tree.getStackItem(), Math.min(canProvide, tree.getMissingItemCount()), this, PromiseType.PROVIDER);
    tree.addPromise(promise);
  }
View Full Code Here


  @Override
  public void canProvide(RequestTreeNode tree, int donePromisses, List<IFilter> filters) {
    int canProvide = getAvailableItemCount(tree.getStackItem());
    canProvide -= donePromisses;
    if (canProvide < 1) return;
    LogisticsPromise promise = new LogisticsPromise(tree.getStackItem(), Math.min(canProvide, tree.getMissingItemCount()), (IProvideItems) _service, PromiseType.PROVIDER);
    tree.addPromise(promise);
  }
View Full Code Here

    }
    _byproduct.add(stack);
  }
 
  public LogisticsPromise generatePromise(int nResultSets) {
    return new LogisticsPromise(_result.getItem(), _result.getStackSize() * nResultSets, _crafter, PromiseType.CRAFTING);
  }
View Full Code Here

      int setsAbleToCraft = calculateMaxWork(setsToCraft); // Deliberately outside the 0 check, because calling generatePromies(0) here clears the old ones.
     
      if(setsAbleToCraft>0) { // sanity check, as creating 0 sized promises is an exception. This should never be hit.
        //LogisticsPipes.log.info("crafting : " + setsToCraft + "sets of " + treeNode.getStack().getItem().getFriendlyName());
        //if we got here, we can at least some of the remaining amount
        LogisticsPromise job = template.generatePromise(setsAbleToCraft);
        if(job.numberOfItems!=setsAbleToCraft*this.setSize)
          throw new IllegalStateException("generatePromises not creating the promisesPromised; this is goign to end badly.");
        treeNode.addPromise(job);
      } else {
        //stacksOfWorkRequested=0; // just incase we call it twice.
View Full Code Here

TOP

Related Classes of logisticspipes.routing.LogisticsPromise

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.