Exemple #1
0
 protected override IEnumerable <ThingDef> AllGeneratableThingsDebugSub(ThingSetMakerParams parms)
 {
     if (parms.traderDef != null)
     {
         for (int i = 0; i < parms.traderDef.stockGenerators.Count; i++)
         {
             StockGenerator stock = parms.traderDef.stockGenerators[i];
             foreach (ThingDef t in from x in DefDatabase <ThingDef> .AllDefs
                      where x.tradeability.TraderCanSell() && stock.HandlesThingDef(x)
                      select x)
             {
                 yield return(t);
             }
         }
     }
 }
Exemple #2
0
        protected override IEnumerable <ThingDef> AllGeneratableThingsDebugSub(ThingSetMakerParams parms)
        {
            if (parms.traderDef != null)
            {
                for (int i = 0; i < parms.traderDef.stockGenerators.Count; i++)
                {
                    _003CAllGeneratableThingsDebugSub_003Ec__Iterator0 _003CAllGeneratableThingsDebugSub_003Ec__Iterator = (_003CAllGeneratableThingsDebugSub_003Ec__Iterator0) /*Error near IL_0055: stateMachine*/;
                    StockGenerator stock = parms.traderDef.stockGenerators[i];
                    using (IEnumerator <ThingDef> enumerator = (from x in DefDatabase <ThingDef> .AllDefs
                                                                where x.tradeability.TraderCanSell() && stock.HandlesThingDef(x)
                                                                select x).GetEnumerator())
                    {
                        if (enumerator.MoveNext())
                        {
                            ThingDef t = enumerator.Current;
                            yield return(t);

                            /*Error: Unable to find new state assignment for yield return*/;
                        }
                    }
                }
            }
            yield break;
IL_0155:
            /*Error near IL_0156: Unexpected return in MoveNext()*/;
        }
Exemple #3
0
 protected override IEnumerable <ThingDef> AllGeneratableThingsDebugSub(ThingSetMakerParams parms)
 {
     if (parms.traderDef == null)
     {
         yield break;
     }
     for (int i = 0; i < parms.traderDef.stockGenerators.Count; i++)
     {
         StockGenerator stock = parms.traderDef.stockGenerators[i];
         foreach (ThingDef item in DefDatabase <ThingDef> .AllDefs.Where((ThingDef x) => x.tradeability.TraderCanSell() && stock.HandlesThingDef(x)))
         {
             yield return(item);
         }
     }
 }