protected override Zone MakeNewZone()
        {
            Zone_Stockpile zone_Stockpile = new Zone_Stockpile(StorageSettingsPreset.DefaultStockpile);

            if (this.emptyZonePreference != null && this.emptyZonePreference.Value)
            {
                if (Find.ZoneManager.AllZones.Count((Zone zone) => zone is Zone_Stockpile) > 1)
                {
                    ThingFilter filter = zone_Stockpile.GetStoreSettings().filter;
                    this.thingDefs.Clear();
                    foreach (ThingDef current in filter.AllowedThingDefs)
                    {
                        this.thingDefs.Add(current);
                    }
                    foreach (ThingDef current2 in this.thingDefs)
                    {
                        filter.SetAllow(current2, false);
                    }
                    foreach (SpecialThingFilterDef current3 in DefDatabase <SpecialThingFilterDef> .AllDefs)
                    {
                        if (filter.Allowed(current3))
                        {
                            filter.SetAllow(current3, false);
                        }
                    }
                }
            }
            return(zone_Stockpile);
        }
예제 #2
0
 public virtual bool CanPossiblyStoreInStockpile(Bill_Production bill, Zone_Stockpile stockpile)
 {
     if (!CanCountProducts(bill))
     {
         return(true);
     }
     return(stockpile.GetStoreSettings().AllowedToAccept(recipe.products[0].thingDef));
 }
예제 #3
0
 public override bool CanPossiblyStoreInStockpile(Bill_Production bill, Zone_Stockpile stockpile)
 {
     foreach (ThingDef allowedThingDef in bill.ingredientFilter.AllowedThingDefs)
     {
         if (!allowedThingDef.butcherProducts.NullOrEmpty())
         {
             if (!stockpile.GetStoreSettings().AllowedToAccept(allowedThingDef))
             {
                 return(false);
             }
         }
     }
     return(true);
 }
예제 #4
0
 public override bool CanPossiblyStoreInStockpile(Bill_Production bill, Zone_Stockpile stockpile)
 {
     foreach (ThingDef allowedThingDef in bill.ingredientFilter.AllowedThingDefs)
     {
         if (allowedThingDef.ingestible != null && allowedThingDef.ingestible.sourceDef != null)
         {
             RaceProperties race = allowedThingDef.ingestible.sourceDef.race;
             if (race != null && race.meatDef != null && !stockpile.GetStoreSettings().AllowedToAccept(race.meatDef))
             {
                 return(false);
             }
         }
     }
     return(true);
 }
 public override bool CanPossiblyStoreInStockpile(Bill_Production bill, Zone_Stockpile stockpile)
 {
     foreach (ThingDef current in bill.ingredientFilter.AllowedThingDefs)
     {
         if (!current.butcherProducts.NullOrEmpty <ThingDefCountClass>())
         {
             ThingDef thingDef = current.butcherProducts[0].thingDef;
             if (!stockpile.GetStoreSettings().AllowedToAccept(thingDef))
             {
                 return(false);
             }
         }
     }
     return(true);
 }
예제 #6
0
 public override bool CanPossiblyStoreInStockpile(Bill_Production bill, Zone_Stockpile stockpile)
 {
     foreach (ThingDef thingDef in bill.ingredientFilter.AllowedThingDefs)
     {
         ResearchProjectDef rpd;
         if (!Base.thingDic.TryGetValue(thingDef, out rpd))
         {
             return(false);
         }
         ThingDef shardDef = ShardMaker.ShardForProject(rpd);
         if (!stockpile.GetStoreSettings().AllowedToAccept(shardDef))
         {
             return(false);
         }
     }
     return(true);
 }