private static bool HasEnoughCraftingMaterial(ItemRoster roster, RefiningFormula formula) { bool result = true; if (formula.Input1Count > 0) { result = result && roster.GetItemNumber(Campaign.Current.Models.SmithingModel.GetCraftingMaterialItem(formula.Input1)) >= formula.Input1Count; } if (formula.Input2Count > 0) { result = result && roster.GetItemNumber(Campaign.Current.Models.SmithingModel.GetCraftingMaterialItem(formula.Input2)) >= formula.Input2Count; } return(result); }
private static int MaxForInput(ItemRoster itemRoster, ItemObject inputitem, int inputcount) { int itemnumber = itemRoster.GetItemNumber(inputitem); if (itemnumber <= 0) { return(0); } return(itemnumber / Math.Abs(inputcount)); }