示例#1
0
 public override IEnumerable <FloatMenuOption> GetShuttleFloatMenuOptions(IEnumerable <IThingHolder> pods, Action <int, TransportPodsArrivalAction> launchAction)
 {
     foreach (FloatMenuOption shuttleFloatMenuOption in base.GetShuttleFloatMenuOptions(pods, launchAction))
     {
         yield return(shuttleFloatMenuOption);
     }
     if ((bool)TransportPodsArrivalAction_GiveGift.CanGiveGiftTo(pods, this))
     {
         yield return(new FloatMenuOption("GiveGiftViaTransportPods".Translate(base.Faction.Name, FactionGiftUtility.GetGoodwillChange(pods, this).ToStringWithSign()), delegate
         {
             TradeRequestComp tradeReqComp = GetComponent <TradeRequestComp>();
             if (tradeReqComp.ActiveRequest && pods.Any((IThingHolder p) => p.GetDirectlyHeldThings().Contains(tradeReqComp.requestThingDef)))
             {
                 Find.WindowStack.Add(new Dialog_MessageBox("GiveGiftViaTransportPodsTradeRequestWarning".Translate(), "Yes".Translate(), delegate
                 {
                     launchAction(base.Tile, new TransportPodsArrivalAction_GiveGift(this));
                 }, "No".Translate()));
             }
             else
             {
                 launchAction(base.Tile, new TransportPodsArrivalAction_GiveGift(this));
             }
         }));
     }
     if (base.HasMap)
     {
         yield break;
     }
     foreach (FloatMenuOption floatMenuOption in TransportPodsArrivalActionUtility.GetFloatMenuOptions(() => TransportPodsArrivalAction_AttackSettlement.CanAttack(pods, this), () => new TransportPodsArrivalAction_Shuttle(this), "AttackShuttle".Translate(Label), launchAction, base.Tile))
     {
         yield return(floatMenuOption);
     }
 }
示例#2
0
        public override FloatMenuAcceptanceReport StillValid(IEnumerable <IThingHolder> pods, int destinationTile)
        {
            FloatMenuAcceptanceReport floatMenuAcceptanceReport = base.StillValid(pods, destinationTile);

            if (!floatMenuAcceptanceReport)
            {
                return(floatMenuAcceptanceReport);
            }
            if (this.settlement != null && this.settlement.Tile != destinationTile)
            {
                return(false);
            }
            return(TransportPodsArrivalAction_GiveGift.CanGiveGiftTo(pods, this.settlement));
        }
示例#3
0
        public override IEnumerable <FloatMenuOption> GetTransportPodsFloatMenuOptions(IEnumerable <IThingHolder> pods, CompLaunchable representative)
        {
            using (IEnumerator <FloatMenuOption> enumerator = base.GetTransportPodsFloatMenuOptions(pods, representative).GetEnumerator())
            {
                if (enumerator.MoveNext())
                {
                    FloatMenuOption o = enumerator.Current;
                    yield return(o);

                    /*Error: Unable to find new state assignment for yield return*/;
                }
            }
            using (IEnumerator <FloatMenuOption> enumerator2 = TransportPodsArrivalAction_VisitSettlement.GetFloatMenuOptions(representative, pods, this).GetEnumerator())
            {
                if (enumerator2.MoveNext())
                {
                    FloatMenuOption f3 = enumerator2.Current;
                    yield return(f3);

                    /*Error: Unable to find new state assignment for yield return*/;
                }
            }
            using (IEnumerator <FloatMenuOption> enumerator3 = TransportPodsArrivalAction_GiveGift.GetFloatMenuOptions(representative, pods, this).GetEnumerator())
            {
                if (enumerator3.MoveNext())
                {
                    FloatMenuOption f2 = enumerator3.Current;
                    yield return(f2);

                    /*Error: Unable to find new state assignment for yield return*/;
                }
            }
            using (IEnumerator <FloatMenuOption> enumerator4 = TransportPodsArrivalAction_AttackSettlement.GetFloatMenuOptions(representative, pods, this).GetEnumerator())
            {
                if (enumerator4.MoveNext())
                {
                    FloatMenuOption f = enumerator4.Current;
                    yield return(f);

                    /*Error: Unable to find new state assignment for yield return*/;
                }
            }
            yield break;
IL_029c:
            /*Error near IL_029d: Unexpected return in MoveNext()*/;
        }
示例#4
0
 public override IEnumerable <FloatMenuOption> GetTransportPodsFloatMenuOptions(IEnumerable <IThingHolder> pods, CompLaunchable representative)
 {
     foreach (FloatMenuOption o in base.GetTransportPodsFloatMenuOptions(pods, representative))
     {
         yield return(o);
     }
     foreach (FloatMenuOption f in TransportPodsArrivalAction_VisitSettlement.GetFloatMenuOptions(representative, pods, this))
     {
         yield return(f);
     }
     foreach (FloatMenuOption f2 in TransportPodsArrivalAction_GiveGift.GetFloatMenuOptions(representative, pods, this))
     {
         yield return(f2);
     }
     foreach (FloatMenuOption f3 in TransportPodsArrivalAction_AttackSettlement.GetFloatMenuOptions(representative, pods, this))
     {
         yield return(f3);
     }
 }
示例#5
0
 public override IEnumerable <FloatMenuOption> GetTransportPodsFloatMenuOptions(IEnumerable <IThingHolder> pods, CompLaunchable representative)
 {
     foreach (FloatMenuOption transportPodsFloatMenuOption in base.GetTransportPodsFloatMenuOptions(pods, representative))
     {
         yield return(transportPodsFloatMenuOption);
     }
     foreach (FloatMenuOption floatMenuOption in TransportPodsArrivalAction_VisitSettlement.GetFloatMenuOptions(representative, pods, this))
     {
         yield return(floatMenuOption);
     }
     foreach (FloatMenuOption floatMenuOption2 in TransportPodsArrivalAction_GiveGift.GetFloatMenuOptions(representative, pods, this))
     {
         yield return(floatMenuOption2);
     }
     if (base.HasMap)
     {
         yield break;
     }
     foreach (FloatMenuOption floatMenuOption3 in TransportPodsArrivalAction_AttackSettlement.GetFloatMenuOptions(representative, pods, this))
     {
         yield return(floatMenuOption3);
     }
 }
示例#6
0
 public static IEnumerable <FloatMenuOption> GetFloatMenuOptions(CompLaunchable representative, IEnumerable <IThingHolder> pods, SettlementBase settlement)
 {
     if (settlement.Faction == Faction.OfPlayer)
     {
         return(Enumerable.Empty <FloatMenuOption>());
     }
     return(TransportPodsArrivalActionUtility.GetFloatMenuOptions <TransportPodsArrivalAction_GiveGift>(() => TransportPodsArrivalAction_GiveGift.CanGiveGiftTo(pods, settlement), () => new TransportPodsArrivalAction_GiveGift(settlement), "GiveGiftViaTransportPods".Translate(new object[]
     {
         settlement.Faction.Name,
         FactionGiftUtility.GetGoodwillChange(pods, settlement).ToStringWithSign()
     }), representative, settlement.Tile));
 }
示例#7
0
 internal FloatMenuAcceptanceReport <> m__0()
 {
     return(TransportPodsArrivalAction_GiveGift.CanGiveGiftTo(this.pods, this.settlement));
 }