public override string BillRequirementsDescription(RecipeDef r, IngredientCount ing)
 {
     if (ing.filter.AllowedThingDefs.Any((ThingDef td) => td.smallVolume) && !ing.filter.AllowedThingDefs.Any((ThingDef td) => td.smallVolume && !r.GetPremultipliedSmallIngredients().Contains(td)))
     {
         return("BillRequires".Translate((float)(ing.GetBaseCount() * 10.0), ing.filter.Summary));
     }
     return("BillRequires".Translate(ing.GetBaseCount(), ing.filter.Summary));
 }
 public override string BillRequirementsDescription(RecipeDef r, IngredientCount ing)
 {
     return("BillRequiresNutrition".Translate(new object[]
     {
         ing.GetBaseCount()
     }) + " (" + ing.filter.Summary + ")");
 }
Exemplo n.º 3
0
        public override string BillRequirementsDescription(RecipeDef r, IngredientCount ing)
        {
            string result;

            if (!ing.filter.AllowedThingDefs.Any((ThingDef td) => td.smallVolume) || ing.filter.AllowedThingDefs.Any((ThingDef td) => td.smallVolume && !r.GetPremultipliedSmallIngredients().Contains(td)))
            {
                result = "BillRequires".Translate(new object[]
                {
                    ing.GetBaseCount(),
                    ing.filter.Summary
                });
            }
            else
            {
                result = "BillRequires".Translate(new object[]
                {
                    ing.GetBaseCount() * 10f,
                    ing.filter.Summary
                });
            }
            return(result);
        }
Exemplo n.º 4
0
        private static IEnumerable <Pair <ThingDef, float> > CheapestIngredients(RecipeDef d)
        {
            using (List <IngredientCount> .Enumerator enumerator = d.ingredients.GetEnumerator())
            {
                if (enumerator.MoveNext())
                {
                    IngredientCount ing   = enumerator.Current;
                    ThingDef        thing = (from td in ing.filter.AllowedThingDefs
                                             where td != ThingDefOf.Meat_Human
                                             select td).MinBy((ThingDef td) => td.BaseMarketValue / td.VolumePerUnit);
                    yield return(new Pair <ThingDef, float>(thing, ing.GetBaseCount() / d.IngredientValueGetter.ValuePerUnitOf(thing)));

                    /*Error: Unable to find new state assignment for yield return*/;
                }
            }
            yield break;
IL_0135:
            /*Error near IL_0136: Unexpected return in MoveNext()*/;
        }