Esempio n. 1
0
    def __init__(self, charID):
        """Constructor"""
        self.charID = charID
        self.blueprints = Blueprints(self.charID)
        self.materials = DataRequest.getAssets(self.charID).materials()
        self.modMatCost = ModifiedManufacturingCost(self.charID)
        self.result = {}

        for blueprintID in self.blueprints.blueprints:
            blueprint = self.blueprints.blueprints[blueprintID]
            if not blueprint.T2.inventable:
                continue
            for idx in range(len(blueprint.T2.inventedIDs)):
                if blueprint.t2Priority[idx][0] == "manufacture":
                    matsBreakdown = self.modMatCost.requiredBaseMaterials(
                        blueprint.T2.inventedIDs[idx])
                    totalMats = matsBreakdown.totalMats()
                    self.result = StaticData.materialAddition(
                        self.result, totalMats)

        print "TOTAL REQUIRED:\n"
        StaticData.printDict(self.result)
        print "\n\nNOT OWNED:\n"
        StaticData.printDict(
            StaticData.materialSubtraction(self.result, self.materials)[0])
Esempio n. 2
0
 def printTotMats(self):
     """print the total mats required for the optimized items"""
     print "ITEMS BUILDABLE WITH CURRENT RESOURCES:"
     for i in self.itemList:
         print "{}".format(StaticData.idName(StaticData.productID(i)))
     print "\n"
     print "TOTAL REQUIRED COMPONENTS:"
     for key in self.finalDict:
         print "{}\t{}".format(StaticData.idName(key), self.finalDict[key])
     print "\n"
     print "MISSING COMPONENTS:"
     remainingMinerals, requiredMats = StaticData.materialSubtraction(
         self.materials, self.finalDict)
     for key in requiredMats:
         if StaticData.producerID(key):
             print "{}\t{}".format(StaticData.idName(key),
                                   self.finalDict[key])