public static IEnumerable <ThingDef> ImpliedBlueprintAndFrameDefs() { foreach (ThingDef def in DefDatabase <ThingDef> .AllDefs.ToList <ThingDef>()) { ThingDef blueprint = null; if (def.BuildableByPlayer) { blueprint = ThingDefGenerator_Buildings.NewBlueprintDef_Thing(def, false, null); yield return(blueprint); yield return(ThingDefGenerator_Buildings.NewFrameDef_Thing(def)); } if (def.Minifiable) { yield return(ThingDefGenerator_Buildings.NewBlueprintDef_Thing(def, true, blueprint)); } } foreach (TerrainDef terrDef in DefDatabase <TerrainDef> .AllDefs) { if (terrDef.BuildableByPlayer) { yield return(ThingDefGenerator_Buildings.NewBlueprintDef_Terrain(terrDef)); yield return(ThingDefGenerator_Buildings.NewFrameDef_Terrain(terrDef)); } } yield break; }
public bool MoveNext() { uint num = (uint)this.$PC; this.$PC = -1; bool flag = false; switch (num) { case 0u: enumerator = DefDatabase <ThingDef> .AllDefs.ToList <ThingDef>().GetEnumerator(); num = 4294967293u; break; case 1u: case 2u: case 3u: break; case 4u: case 5u: goto IL_16D; default: return(false); } try { switch (num) { case 1u: this.$current = ThingDefGenerator_Buildings.NewFrameDef_Thing(def); if (!this.$disposing) { this.$PC = 2; } flag = true; return(true); case 2u: break; case 3u: goto IL_12D; default: goto IL_12E; } IL_ED: if (def.Minifiable) { this.$current = ThingDefGenerator_Buildings.NewBlueprintDef_Thing(def, true, blueprint); if (!this.$disposing) { this.$PC = 3; } flag = true; return(true); } IL_12D: IL_12E: if (enumerator.MoveNext()) { def = enumerator.Current; blueprint = null; if (def.BuildableByPlayer) { blueprint = ThingDefGenerator_Buildings.NewBlueprintDef_Thing(def, false, null); this.$current = blueprint; if (!this.$disposing) { this.$PC = 1; } flag = true; return(true); } goto IL_ED; } } finally { if (!flag) { ((IDisposable)enumerator).Dispose(); } } enumerator2 = DefDatabase <TerrainDef> .AllDefs.GetEnumerator(); num = 4294967293u; try { IL_16D: switch (num) { case 4u: this.$current = ThingDefGenerator_Buildings.NewFrameDef_Terrain(terrDef); if (!this.$disposing) { this.$PC = 5; } flag = true; return(true); } while (enumerator2.MoveNext()) { terrDef = enumerator2.Current; if (terrDef.BuildableByPlayer) { this.$current = ThingDefGenerator_Buildings.NewBlueprintDef_Terrain(terrDef); if (!this.$disposing) { this.$PC = 4; } flag = true; return(true); } } } finally { if (!flag) { if (enumerator2 != null) { enumerator2.Dispose(); } } } this.$PC = -1; return(false); }