Beispiel #1
0
        public override IEnumerable <StatDrawEntry> SpecialDisplayStats(StatRequest req)
        {
            using (IEnumerator <StatDrawEntry> enumerator = base.SpecialDisplayStats(req).GetEnumerator())
            {
                if (enumerator.MoveNext())
                {
                    StatDrawEntry stat = enumerator.Current;
                    yield return(stat);

                    /*Error: Unable to find new state assignment for yield return*/;
                }
            }
            IEnumerable <TerrainAffordanceDef> affdefs = Enumerable.Empty <TerrainAffordanceDef>();

            if (PlaceWorkers != null)
            {
                affdefs = affdefs.Concat(PlaceWorkers.SelectMany((PlaceWorker pw) => pw.DisplayAffordances()));
            }
            if (terrainAffordanceNeeded != null)
            {
                affdefs = affdefs.Concat(terrainAffordanceNeeded);
            }
            string[] affordances = (from ta in affdefs.Distinct()
                                    orderby ta.order
                                    select ta.label).ToArray();
            if (affordances.Length > 0)
            {
                yield return(new StatDrawEntry(StatCategoryDefOf.Basics, "TerrainRequirement".Translate(), affordances.ToCommaList().CapitalizeFirst(), 0, string.Empty));

                /*Error: Unable to find new state assignment for yield return*/;
            }
            yield break;
IL_01f5:
            /*Error near IL_01f6: Unexpected return in MoveNext()*/;
        }
        public override IEnumerable <StatDrawEntry> SpecialDisplayStats(StatRequest req)
        {
            foreach (StatDrawEntry item in base.SpecialDisplayStats(req))
            {
                yield return(item);
            }
            if (!BuildableByPlayer)
            {
                yield break;
            }
            IEnumerable <TerrainAffordanceDef> enumerable = Enumerable.Empty <TerrainAffordanceDef>();

            if (PlaceWorkers != null)
            {
                enumerable = enumerable.Concat(PlaceWorkers.SelectMany((PlaceWorker pw) => pw.DisplayAffordances()));
            }
            TerrainAffordanceDef terrainAffordanceNeed = this.GetTerrainAffordanceNeed(req.StuffDef);

            if (terrainAffordanceNeed != null)
            {
                enumerable = enumerable.Concat(terrainAffordanceNeed);
            }
            string[] array = (from ta in enumerable.Distinct()
                              orderby ta.order
                              select ta.label).ToArray();
            if (array.Length != 0)
            {
                yield return(new StatDrawEntry(StatCategoryDefOf.Basics, "TerrainRequirement".Translate(), array.ToCommaList().CapitalizeFirst(), "Stat_Thing_TerrainRequirement_Desc".Translate(), 1101));
            }
        }