Beispiel #1
0
 protected virtual BillReport CheckBills()
 {
     foreach (Bill b in AllBillsShouldDoNow)
     {
         List <ThingCount> chosen = new List <ThingCount>();
         if (TryFindBestBillIngredientsInSet(AllAccessibleThings.ToList(), b, chosen))
         {
             return(new BillReport(b, (from ta in chosen select ta.Thing.SplitOff(ta.Count)).ToList()));
         }
     }
     return(null);
 }
Beispiel #2
0
        // TryGetNextBill returns a new BillReport to start if one is available
        protected BillReport TryGetNextBill()
        {
            foreach (Bill b in AllBillsShouldDoNow)
            {
                List <ThingCount> chosen = new List <ThingCount>();

                List <Thing> allAccessibleAllowedThings = AllAccessibleThings.Where(x => b.IsFixedOrAllowedIngredient(x)).ToList();

                if (allAccessibleAllowedThings.Count > 0 || b.ingredientFilter.AllowedThingDefs.Count() == 0)
                {
                    if (TryFindBestBillIngredientsInSet(allAccessibleAllowedThings, b, chosen))
                    {
                        return(new BillReport(b, (from ta in chosen select ta.Thing.SplitOff(ta.Count)).ToList()));
                    }
                }
            }
            return(null);
        }
Beispiel #3
0
        protected virtual IEnumerable <FloatMenuOption> GetDebugOptions()
        {
            string StringConverter(Thing t)
            {
                return(t.GetUniqueLoadID());
            }

            yield return(new FloatMenuOption("View selected things", () => {
                if (currentBillReport != null)
                {
                    Log.Message("Selected things: " + string.Join(", ", currentBillReport.selected.Select(StringConverter).ToArray()));
                }
            }));

            yield return(new FloatMenuOption("View all items available for input", () =>
            {
                Log.Message(string.Join(", ", AllAccessibleThings.Select(StringConverter).ToArray()));
            }));

            yield break;
        }