public ManagerJob_Foraging( Manager manager )
: base(manager)
{
// all plants that yield something, and it isn't wood.
AllowedPlants = manager.map.Biome.AllWildPlants
.Where( plant => plant.plant.harvestYield > 0 &&
plant.plant.harvestedThingDef != null &&
plant.plant.harvestTag != "Wood" )
.ToDictionary( k => k, v => false );
// add cave world fauna
List<ThingDef> caveWorldFauna =
DefDatabase<ThingDef>.AllDefsListForReading.Where(
def =>
def.plant?.sowTags.Contains( "Fungiponics" ) ?? false )
.ToList();
foreach ( ThingDef fungus in caveWorldFauna )
{
AllowedPlants.Add( fungus, false );
}
// populate the trigger field, count all harvested thingdefs from the allowed plant list
Trigger = new Trigger_Threshold( this );
Trigger.ThresholdFilter.SetDisallowAll();
foreach ( ThingDef plant in AllowedPlants.Keys )
{
Trigger.ThresholdFilter.SetAllow( plant.plant.harvestedThingDef, true );
}
// create History tracker
History = new History( new[] {"stock", "designated"}, new[] {Color.white, Color.grey} );
}