private static float CheapestProductsValue(RecipeDef d) { float num = 0f; foreach (ThingDefCountClass current in d.products) { num += current.thingDef.GetStatValueAbstract(StatDefOf.MarketValue, DebugOutputsEconomy.CheapestNonDerpStuff(d)) * (float)current.count; } return(num); }
private static float TrueWorkWithCarryTime(RecipeDef d) { ThingDef stuffDef = DebugOutputsEconomy.CheapestNonDerpStuff(d); return((float)d.ingredients.Count * 90f + d.WorkAmountTotal(stuffDef) + 90f); }
public static void Recipes() { IEnumerable <RecipeDef> arg_229_0 = from d in DefDatabase <RecipeDef> .AllDefs where !d.products.NullOrEmpty <ThingDefCountClass>() && !d.ingredients.NullOrEmpty <IngredientCount>() select d; TableDataGetter <RecipeDef>[] expr_2E = new TableDataGetter <RecipeDef> [12]; expr_2E[0] = new TableDataGetter <RecipeDef>("defName", (RecipeDef d) => d.defName); expr_2E[1] = new TableDataGetter <RecipeDef>("work /w carry", (RecipeDef d) => DebugOutputsEconomy.TrueWorkWithCarryTime(d).ToString("F0")); expr_2E[2] = new TableDataGetter <RecipeDef>("work seconds", (RecipeDef d) => (DebugOutputsEconomy.TrueWorkWithCarryTime(d) / 60f).ToString("F0")); expr_2E[3] = new TableDataGetter <RecipeDef>("cheapest products value", (RecipeDef d) => DebugOutputsEconomy.CheapestProductsValue(d).ToString("F1")); expr_2E[4] = new TableDataGetter <RecipeDef>("cheapest ingredients value", (RecipeDef d) => DebugOutputsEconomy.CheapestIngredientValue(d).ToString("F1")); expr_2E[5] = new TableDataGetter <RecipeDef>("work value", (RecipeDef d) => DebugOutputsEconomy.WorkValueEstimate(d).ToString("F1")); expr_2E[6] = new TableDataGetter <RecipeDef>("profit raw", (RecipeDef d) => (DebugOutputsEconomy.CheapestProductsValue(d) - DebugOutputsEconomy.CheapestIngredientValue(d)).ToString("F1")); expr_2E[7] = new TableDataGetter <RecipeDef>("profit with work", (RecipeDef d) => (DebugOutputsEconomy.CheapestProductsValue(d) - DebugOutputsEconomy.WorkValueEstimate(d) - DebugOutputsEconomy.CheapestIngredientValue(d)).ToString("F1")); expr_2E[8] = new TableDataGetter <RecipeDef>("profit per work day", (RecipeDef d) => ((DebugOutputsEconomy.CheapestProductsValue(d) - DebugOutputsEconomy.CheapestIngredientValue(d)) * 60000f / DebugOutputsEconomy.TrueWorkWithCarryTime(d)).ToString("F0")); expr_2E[9] = new TableDataGetter <RecipeDef>("min skill", (RecipeDef d) => (!d.skillRequirements.NullOrEmpty <SkillRequirement>()) ? d.skillRequirements[0].Summary : string.Empty); expr_2E[10] = new TableDataGetter <RecipeDef>("cheapest stuff", (RecipeDef d) => (DebugOutputsEconomy.CheapestNonDerpStuff(d) == null) ? string.Empty : DebugOutputsEconomy.CheapestNonDerpStuff(d).defName); expr_2E[11] = new TableDataGetter <RecipeDef>("cheapest ingredients", (RecipeDef d) => (from pa in DebugOutputsEconomy.CheapestIngredients(d) select pa.First.defName + " x" + pa.Second).ToCommaList(false)); DebugTables.MakeTablesDialog <RecipeDef>(arg_229_0, expr_2E); }