public static IEnumerable <Thing> AllLaunchableThings(Map map) { HashSet <Thing> yieldedThings = new HashSet <Thing>(); foreach (Building_OrbitalTradeBeacon item in Building_OrbitalTradeBeacon.AllPowered(map)) { foreach (IntVec3 tradeableCell in item.TradeableCells) { List <Thing> thingList = tradeableCell.GetThingList(map); for (int i = 0; i < thingList.Count; i++) { Thing t = thingList[i]; if (TradeUtility.EverTradeable(t.def) && t.def.category == ThingCategory.Item && !yieldedThings.Contains(t) && TradeUtility.TradeableNow(t)) { yieldedThings.Add(t); yield return(t); /*Error: Unable to find new state assignment for yield return*/; } } } } yield break; IL_01f0: /*Error near IL_01f1: Unexpected return in MoveNext()*/; }
public IEnumerable <Thing> ColonyThingsWillingToBuy(Pawn playerNegotiator) { IEnumerable <Thing> items = from x in this.pawn.Map.listerThings.AllThings where TradeUtility.EverTradeable(x.def) && x.def.category == ThingCategory.Item && !x.Position.Fogged(x.Map) && (((Area)((_003CColonyThingsWillingToBuy_003Ec__Iterator1) /*Error near IL_0042: stateMachine*/)._0024this.pawn.Map.areaManager.Home)[x.Position] || x.IsInAnyStorage()) && TradeUtility.TradeableNow(x) && ((_003CColonyThingsWillingToBuy_003Ec__Iterator1) /*Error near IL_0042: stateMachine*/)._0024this.ReachableForTrade(x) select x; using (IEnumerator <Thing> enumerator = items.GetEnumerator()) { if (enumerator.MoveNext()) { Thing t = enumerator.Current; yield return(t); /*Error: Unable to find new state assignment for yield return*/; } } if (this.pawn.GetLord() != null) { using (IEnumerator <Pawn> enumerator2 = (from x in TradeUtility.AllSellableColonyPawns(this.pawn.Map) where !x.Downed && ((_003CColonyThingsWillingToBuy_003Ec__Iterator1) /*Error near IL_011d: stateMachine*/)._0024this.ReachableForTrade(x) select x).GetEnumerator()) { if (enumerator2.MoveNext()) { Pawn p = enumerator2.Current; yield return((Thing)p); /*Error: Unable to find new state assignment for yield return*/; } } } yield break; IL_01b8: /*Error near IL_01b9: Unexpected return in MoveNext()*/; }
public override bool ShouldShowFor(BuildableDef def) { ThingDef thingDef = def as ThingDef; if (thingDef == null) { return(false); } return(TradeUtility.EverTradeable(thingDef) || thingDef.category == ThingCategory.Building); }
public static IEnumerable <Thing> AllLaunchableThings(Map map) { HashSet <Thing> yieldedThings = new HashSet <Thing>(); foreach (Building_OrbitalTradeBeacon beacon in Building_OrbitalTradeBeacon.AllPowered(map)) { foreach (IntVec3 c in beacon.TradeableCells) { List <Thing> thingList = c.GetThingList(map); for (int i = 0; i < thingList.Count; i++) { Thing t = thingList[i]; if (TradeUtility.EverTradeable(t.def) && t.def.category == ThingCategory.Item && !yieldedThings.Contains(t) && TradeUtility.TradeableNow(t)) { yieldedThings.Add(t); yield return(t); } } } } }
public IEnumerable <Thing> ColonyThingsWillingToBuy(Pawn playerNegotiator) { IEnumerable <Thing> items = from x in this.pawn.Map.listerThings.AllThings where TradeUtility.EverTradeable(x.def) && x.def.category == ThingCategory.Item && !x.Position.Fogged(x.Map) && (this.$this.pawn.Map.areaManager.Home[x.Position] || x.IsInAnyStorage()) && TradeUtility.TradeableNow(x) && this.$this.ReachableForTrade(x) select x; foreach (Thing t in items) { yield return(t); } bool hasLord = this.pawn.GetLord() != null; if (hasLord) { foreach (Pawn p in from x in TradeUtility.AllSellableColonyPawns(this.pawn.Map) where !x.Downed && this.$this.ReachableForTrade(x) select x) { yield return(p); } } }
public override bool ShouldShowFor(BuildableDef def) { ThingDef thingDef = def as ThingDef; return(thingDef != null && (TradeUtility.EverTradeable(thingDef) || thingDef.category == ThingCategory.Building)); }