Package logisticspipes.routing

Examples of logisticspipes.routing.LogisticsExtraPromise


    if(getMissingItemCount() == 0) throw new IllegalArgumentException("zero count needed, promises not needed.");
    if(promise.numberOfItems > getMissingItemCount()) {
      int more = promise.numberOfItems - getMissingItemCount();
      promise.numberOfItems = getMissingItemCount();
      //Add Extra
      LogisticsExtraPromise extra = new LogisticsExtraPromise(promise.item, more, promise.sender, false);
      extrapromises.add(extra);
    }
    if(promise.numberOfItems <= 0) throw new IllegalArgumentException("zero count ... again");
    promises.add(promise);
    promiseItemCount += promise.numberOfItems;
View Full Code Here


  protected void removeUsedExtras(ItemIdentifier item, HashMap<IProvideItems,List<LogisticsExtraPromise>> extraMap) {
    for(LogisticsPromise promise:promises) {
      if(!promise.item.equals(item)) continue;
      if(!(promise instanceof LogisticsExtraPromise)) continue;
      LogisticsExtraPromise epromise = (LogisticsExtraPromise)promise;
      if(epromise.provided) continue;
      int usedcount = epromise.numberOfItems;
      List<LogisticsExtraPromise> extras = extraMap.get(epromise.sender);
      if(extras == null) continue;
      for(Iterator<LogisticsExtraPromise> it = extras.iterator(); it.hasNext();) {
        LogisticsExtraPromise extra = it.next();
        if(extra.numberOfItems >= usedcount) {
          extra.numberOfItems -= usedcount;
          usedcount = 0;
          break;
        } else {
View Full Code Here

      }
     
      return generateRequestTreeFor(workSetsAvailable, template);
    }
    for(ItemIdentifierStack stack:template.getByproduct()) {
      LogisticsExtraPromise extra = new LogisticsExtraPromise(stack.getItem(), stack.getStackSize() * workSetsAvailable, template.getCrafter(), false);
      byproducts.add(extra);
    }
    return workSetsAvailable;
  }
View Full Code Here

        }
        return 0;
      }
    }
    for(ItemIdentifierStack stack:template.getByproduct()) {
      LogisticsExtraPromise extra = new LogisticsExtraPromise(stack.getItem(), stack.getStackSize() * workSets, template.getCrafter(), false);
      byproducts.add(extra);
    }
    return workSets;
  }
View Full Code Here

      }
       
    }
    remaining -= donePromisses;
    if (remaining < 1) return;
    LogisticsExtraPromise promise = new LogisticsExtraPromise(requestedItem, Math.min(remaining, tree.getMissingItemCount()), this, true);
    tree.addPromise(promise);
   
  }
View Full Code Here

TOP

Related Classes of logisticspipes.routing.LogisticsExtraPromise

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.