private static IEnumerable <StatDrawEntry> StatsToDraw(Def def, ThingDef stuff) { _003CStatsToDraw_003Ec__Iterator0 _003CStatsToDraw_003Ec__Iterator = (_003CStatsToDraw_003Ec__Iterator0) /*Error near IL_0038: stateMachine*/; yield return(StatsReportUtility.DescriptionEntry(def)); /*Error: Unable to find new state assignment for yield return*/; }
private static IEnumerable <StatDrawEntry> StatsToDraw(WorldObject worldObject) { yield return(StatsReportUtility.DescriptionEntry(worldObject)); foreach (StatDrawEntry stat in worldObject.SpecialDisplayStats) { yield return(stat); } }
private static IEnumerable <StatDrawEntry> StatsToDraw(Def def, ThingDef stuff) { yield return(StatsReportUtility.DescriptionEntry(def)); BuildableDef eDef = def as BuildableDef; if (eDef != null) { foreach (StatDef stat in from st in DefDatabase <StatDef> .AllDefs where st.Worker.ShouldShowFor(eDef) select st) { yield return(new StatDrawEntry(stat.category, stat, eDef.GetStatValueAbstract(stat, stuff), StatRequest.For(eDef, stuff, QualityCategory.Normal), ToStringNumberSense.Undefined)); } } }
public bool MoveNext() { uint num = (uint)this.$PC; this.$PC = -1; bool flag = false; switch (num) { case 0u: this.$current = StatsReportUtility.DescriptionEntry(def); if (!this.$disposing) { this.$PC = 1; } return(true); case 1u: { eDef = (def as BuildableDef); if (eDef == null) { goto IL_179; } StatRequest statRequest = StatRequest.For(eDef, stuff, QualityCategory.Normal); enumerator = (from st in DefDatabase <StatDef> .AllDefs where st.Worker.ShouldShowFor(statRequest) select st).GetEnumerator(); num = 4294967293u; break; } case 2u: break; default: return(false); } try { switch (num) { } if (enumerator.MoveNext()) { stat = enumerator.Current; this.$current = new StatDrawEntry(stat.category, stat, eDef.GetStatValueAbstract(stat, stuff), StatRequest.For(eDef, stuff, QualityCategory.Normal), ToStringNumberSense.Undefined); if (!this.$disposing) { this.$PC = 2; } flag = true; return(true); } } finally { if (!flag) { if (enumerator != null) { enumerator.Dispose(); } } } IL_179: this.$PC = -1; return(false); }
private static IEnumerable <StatDrawEntry> StatsToDraw(Thing thing) { yield return(StatsReportUtility.DescriptionEntry(thing)); StatDrawEntry qe = StatsReportUtility.QualityEntry(thing); if (qe != null) { yield return(qe); } foreach (StatDef stat in from st in DefDatabase <StatDef> .AllDefs where st.Worker.ShouldShowFor(StatRequest.For(thing)) select st) { if (!stat.Worker.IsDisabledFor(thing)) { yield return(new StatDrawEntry(stat.category, stat, thing.GetStatValue(stat, true), StatRequest.For(thing), ToStringNumberSense.Undefined)); } else { yield return(new StatDrawEntry(stat.category, stat)); } } if (thing.def.useHitPoints) { yield return(new StatDrawEntry(StatCategoryDefOf.BasicsNonPawn, "HitPointsBasic".Translate().CapitalizeFirst(), thing.HitPoints.ToString() + " / " + thing.MaxHitPoints.ToString(), 0, "") { overrideReportText = string.Concat(new string[] { "HitPointsBasic".Translate().CapitalizeFirst(), ":\n\n", thing.HitPoints.ToString(), "\n\n", StatDefOf.MaxHitPoints.LabelCap, ":\n\n", StatDefOf.MaxHitPoints.Worker.GetExplanationUnfinalized(StatRequest.For(thing), ToStringNumberSense.Absolute) }) }); } foreach (StatDrawEntry stat2 in thing.SpecialDisplayStats()) { yield return(stat2); } if (!thing.def.equippedStatOffsets.NullOrEmpty <StatModifier>()) { for (int i = 0; i < thing.def.equippedStatOffsets.Count; i++) { yield return(new StatDrawEntry(StatCategoryDefOf.EquippedStatOffsets, thing.def.equippedStatOffsets[i].stat, thing.def.equippedStatOffsets[i].value, StatRequest.ForEmpty(), ToStringNumberSense.Offset)); } } if (thing.def.IsStuff) { if (!thing.def.stuffProps.statFactors.NullOrEmpty <StatModifier>()) { for (int j = 0; j < thing.def.stuffProps.statFactors.Count; j++) { yield return(new StatDrawEntry(StatCategoryDefOf.StuffStatFactors, thing.def.stuffProps.statFactors[j].stat, thing.def.stuffProps.statFactors[j].value, StatRequest.ForEmpty(), ToStringNumberSense.Factor)); } } if (!thing.def.stuffProps.statOffsets.NullOrEmpty <StatModifier>()) { for (int k = 0; k < thing.def.stuffProps.statOffsets.Count; k++) { yield return(new StatDrawEntry(StatCategoryDefOf.StuffStatOffsets, thing.def.stuffProps.statOffsets[k].stat, thing.def.stuffProps.statOffsets[k].value, StatRequest.ForEmpty(), ToStringNumberSense.Offset)); } } } yield break; }
private static IEnumerable <StatDrawEntry> StatsToDraw(WorldObject worldObject) { yield return(StatsReportUtility.DescriptionEntry(worldObject)); /*Error: Unable to find new state assignment for yield return*/; }