public static IEnumerable <IWorkAmount> GetAll()
 {
     foreach (var x in DefDatabase <ThingDef> .AllDefsListForReading.Where(x => x.plant != null))
     {
         PlantGrowDays plantGrowDays = new PlantGrowDays(x);
         if (plantGrowDays.HasWorkValue())
         {
             yield return(plantGrowDays);
         }
     }
 }
示例#2
0
        public override void DefsLoaded()
        {
            workDefDatabase.Clear();
            workDefDatabase.AddRange(RecipeWorkAmount.GetAll());
            workDefDatabase.AddRange(ThingWorkAmount.GetAll());
            workDefDatabase.AddRange(TerrainWorkAmount.GetAll());
            workDefDatabase.AddRange(ResearchWorkAmount.GetAll());
            workDefDatabase.AddRange(PlantGrowDays.GetAll());
            workDefDatabase.AddRange(PlantWorkAmount.GetAll());

            InitializeSettings();
            ApplySettings();

            Log.Message($"WorkRebalancerMod :: DefsLoaded");
        }