private bool IsValidForagingTarget( Plant p )
{
// should be a plant, and be on the same map as this job
return p.def.plant != null
&& p.Map == manager.map
// non-biome plants won't be on the list, also filters non-yield or wood plants
&& AllowedPlants.ContainsKey( p.def )
&& AllowedPlants[p.def]
&& p.Spawned
&& manager.map.designationManager.DesignationOn( p ) == null
// cut only mature plants, or non-mature that yield something right now.
&& ( ( !ForceFullyMature && p.YieldNow() > 1 )
|| p.LifeStage == PlantLifeStage.Mature )
// limit to area of interest
&& ( ForagingArea == null
|| ForagingArea.ActiveCells.Contains( p.Position ) )
// can we reach it? ( can it reach us? )
&& manager.map.reachability.CanReachColony( p.Position );
}