Fix bugs with new crafting algo

This commit is contained in:
Andrew Miner
2015-11-10 20:08:03 -08:00
parent 4e95ab998f
commit ff398b4a2f
23 changed files with 255 additions and 78 deletions
+8 -2
View File
@@ -19,6 +19,11 @@ MOD_VERSION_FILE =
"""
schema: 1
item: Bed
recipe:
input: Oak Planks, Wool
pattern: ... 000 111
item: Charcoal
recipe:
input: 8 Oak Wood, Coal
@@ -140,14 +145,15 @@ module.exports = fixtures =
makePlans: (stacks...)->
modPack = fixtures.makeModPack()
have = new Inventory
want = new Inventory
for stack in stacks
want.add ItemSlug.slugify(stack[1]), stack[0]
graphBuilder = new GraphBuilder modPack:fixtures.makeModPack(), want:want
graphBuilder = new GraphBuilder modPack:modPack, want:want
graphBuilder.expandGraph()
planBuilder = new PlanBuilder graphBuilder.rootNode, modPack, want:graphBuilder.want
planBuilder = new PlanBuilder graphBuilder.rootNode, modPack, want:want, have:have
return planBuilder.producePlans()
makeTree: (itemSlug, quantity=1)->