protected virtual void ProduceItems() { if (currentBillReport == null) { Log.Error("Project RimFactory :: Tried to make products when assembler isn't engaged in a bill."); return; } // GenRecipe handles creating any bonus products IEnumerable <Thing> products = GenRecipe.MakeRecipeProducts(currentBillReport.bill.recipe, buildingPawn, currentBillReport.selected, ProjectSAL_Utilities.CalculateDominantIngredient(currentBillReport.bill.recipe, currentBillReport.selected), this); foreach (Thing thing in products) { PostProcessRecipeProduct(thing); thingQueue.Add(thing); } for (int i = 0; i < currentBillReport.selected.Count; i++) { if (currentBillReport.selected[i] is Corpse c && c.InnerPawn?.apparel != null) { List <Apparel> apparel = new List <Apparel>(c.InnerPawn.apparel.WornApparel); for (int j = 0; j < apparel.Count; j++) { thingQueue.Add(apparel[j]); c.InnerPawn.apparel.Remove(apparel[j]); } } currentBillReport.bill.recipe.Worker.ConsumeIngredient(currentBillReport.selected[i], currentBillReport.bill.recipe, Map); } thingQueue.AddRange(from Thing t in currentBillReport.selected where t.Spawned select t); }
public BillReport(Bill b, List <Thing> list) { bill = b; selected = list; workLeft = b.recipe.WorkAmountTotal(ProjectSAL_Utilities.CalculateDominantIngredient(b.recipe, list).def); }