public static IEnumerable <Thing> TryMakeForStock(ThingDef thingDef, int count) { if (thingDef.MadeFromStuff) { int i = 0; Thing th2; while (true) { if (i < count) { th2 = StockGeneratorUtility.TryMakeForStockSingle(thingDef, 1); if (th2 == null) { i++; continue; } break; } yield break; } yield return(th2); /*Error: Unable to find new state assignment for yield return*/; } Thing th = StockGeneratorUtility.TryMakeForStockSingle(thingDef, count); if (th == null) { yield break; } yield return(th); /*Error: Unable to find new state assignment for yield return*/; }
public static IEnumerable <Thing> TryMakeForStock(ThingDef thingDef, int count) { if (thingDef.MadeFromStuff) { for (int i = 0; i < count; i++) { Thing th = StockGeneratorUtility.TryMakeForStockSingle(thingDef, 1); if (th != null) { yield return(th); } } } else { Thing th2 = StockGeneratorUtility.TryMakeForStockSingle(thingDef, count); if (th2 != null) { yield return(th2); } } }
protected virtual Thing MakeThing(ThingDef def) { return(StockGeneratorUtility.TryMakeForStockSingle(def, 1)); }