Esempio n. 1
0
 public static IEnumerable <FloatMenuOption> GetVisitFloatMenuOptions(CompLaunchableHelicopter representative, IEnumerable <IThingHolder> pods, SettlementBase settlement, Caravan car)
 {
     return(HelicoptersArrivalActionUtility.GetFloatMenuOptions <TransportPodsArrivalAction_VisitSettlement>(() => TransportPodsArrivalAction_VisitSettlement.CanVisit(pods, settlement), () => new TransportPodsArrivalAction_VisitSettlement(settlement), "VisitSettlement".Translate(new object[]
     {
         settlement.Label
     }), representative, settlement.Tile, car));
 }
        public static IEnumerable <FloatMenuOption> GetSettle(
            SettlementBase bs,
            IEnumerable <IThingHolder> pods,
            CompLaunchableHelicopter representative,
            Caravan car)
        {
            foreach (FloatMenuOption floatMenuOption in HelicopterStatic.GetMapParent((MapParent)bs, pods, representative, car))
            {
                FloatMenuOption o = floatMenuOption;
                yield return(o);

                o = (FloatMenuOption)null;
            }
            foreach (FloatMenuOption visitFloatMenuOption in HelicoptersArrivalActionUtility.GetVisitFloatMenuOptions(representative, pods, bs, car))
            {
                FloatMenuOption f = visitFloatMenuOption;
                yield return(f);

                f = (FloatMenuOption)null;
            }
            foreach (FloatMenuOption giftFloatMenuOption in HelicoptersArrivalActionUtility.GetGIFTFloatMenuOptions(representative, pods, bs, car))
            {
                FloatMenuOption f2 = giftFloatMenuOption;
                yield return(f2);

                f2 = (FloatMenuOption)null;
            }
            foreach (FloatMenuOption atkFloatMenuOption in HelicoptersArrivalActionUtility.GetATKFloatMenuOptions(representative, pods, bs, car))
            {
                FloatMenuOption f3 = atkFloatMenuOption;
                yield return(f3);

                f3 = (FloatMenuOption)null;
            }
        }
Esempio n. 3
0
        public static IEnumerable <FloatMenuOption> GetATKFloatMenuOptions(
            CompLaunchableHelicopter representative,
            IEnumerable <IThingHolder> pods,
            SettlementBase settlement,
            Caravan car)
        {
            Func <FloatMenuAcceptanceReport> acceptanceReportGetter1 = (Func <FloatMenuAcceptanceReport>)(() => TransportPodsArrivalAction_AttackSettlement.CanAttack(pods, settlement));
            Func <TransportPodsArrivalAction_AttackSettlement> arrivalActionGetter1 = (Func <TransportPodsArrivalAction_AttackSettlement>)(() => new TransportPodsArrivalAction_AttackSettlement(settlement, PawnsArrivalModeDefOf.EdgeDrop));

            object[] objArray1 = new object[1]
            {
                (object)settlement.Label
            };
            foreach (FloatMenuOption floatMenuOption in HelicoptersArrivalActionUtility.GetFloatMenuOptions <TransportPodsArrivalAction_AttackSettlement>(acceptanceReportGetter1, arrivalActionGetter1, "AttackAndDropAtEdge".Translate(objArray1), representative, settlement.Tile, car))
            {
                FloatMenuOption f = floatMenuOption;
                yield return(f);

                f = (FloatMenuOption)null;
            }
            Func <FloatMenuAcceptanceReport> acceptanceReportGetter2 = (Func <FloatMenuAcceptanceReport>)(() => TransportPodsArrivalAction_AttackSettlement.CanAttack(pods, settlement));
            Func <TransportPodsArrivalAction_AttackSettlement> arrivalActionGetter2 = (Func <TransportPodsArrivalAction_AttackSettlement>)(() => new TransportPodsArrivalAction_AttackSettlement(settlement, PawnsArrivalModeDefOf.CenterDrop));

            object[] objArray2 = new object[1]
            {
                (object)settlement.Label
            };
            foreach (FloatMenuOption floatMenuOption in HelicoptersArrivalActionUtility.GetFloatMenuOptions <TransportPodsArrivalAction_AttackSettlement>(acceptanceReportGetter2, arrivalActionGetter2, "AttackAndDropInCenter".Translate(objArray2), representative, settlement.Tile, car))
            {
                FloatMenuOption f2 = floatMenuOption;
                yield return(f2);

                f2 = (FloatMenuOption)null;
            }
        }
Esempio n. 4
0
 public static IEnumerable <FloatMenuOption> GetGIFTFloatMenuOptions(CompLaunchableHelicopter representative, IEnumerable <IThingHolder> pods, Settlement settlement, Caravan car)
 {
     if (settlement.Faction == Faction.OfPlayer)
     {
         return(Enumerable.Empty <FloatMenuOption>());
     }
     return(HelicoptersArrivalActionUtility.GetFloatMenuOptions <TransportPodsArrivalAction_GiveGift>(() => TransportPodsArrivalAction_GiveGift.CanGiveGiftTo(pods, settlement),
                                                                                                      () => new TransportPodsArrivalAction_GiveGift(settlement), "GiveGiftViaTransportPods".Translate(settlement.Faction.Name,
                                                                                                                                                                                                      FactionGiftUtility.GetGoodwillChange(pods, settlement).ToStringWithSign()), representative, settlement.Tile, car));
 }
Esempio n. 5
0
 public static IEnumerable <FloatMenuOption> GetVisitSite(CompLaunchableHelicopter representative, IEnumerable <IThingHolder> pods, Site site, Caravan car)
 {
     foreach (FloatMenuOption f in HelicoptersArrivalActionUtility.GetFloatMenuOptions <TransportPodsArrivalAction_VisitSite>(() => TransportPodsArrivalAction_VisitSite.CanVisit(pods, site), () => new TransportPodsArrivalAction_VisitSite(site, PawnsArrivalModeDefOf.EdgeDrop), "DropAtEdge".Translate(), representative, site.Tile, car))
     {
         yield return(f);
     }
     foreach (FloatMenuOption f2 in HelicoptersArrivalActionUtility.GetFloatMenuOptions <TransportPodsArrivalAction_VisitSite>(() => TransportPodsArrivalAction_VisitSite.CanVisit(pods, site), () => new TransportPodsArrivalAction_VisitSite(site, PawnsArrivalModeDefOf.CenterDrop), "DropInCenter".Translate(), representative, site.Tile, car))
     {
         yield return(f2);
     }
     yield break;
 }
Esempio n. 6
0
 public static IEnumerable <FloatMenuOption> GetATKFloatMenuOptions(CompLaunchableHelicopter representative, IEnumerable <IThingHolder> pods, Settlement settlement, Caravan car)
 {
     foreach (FloatMenuOption f in HelicoptersArrivalActionUtility.GetFloatMenuOptions <TransportPodsArrivalAction_AttackSettlement>(() => TransportPodsArrivalAction_AttackSettlement.CanAttack(pods, settlement), () => new TransportPodsArrivalAction_AttackSettlement(settlement, PawnsArrivalModeDefOf.EdgeDrop), "AttackAndDropAtEdge".Translate(settlement.Label), representative, settlement.Tile, car))
     {
         yield return(f);
     }
     foreach (FloatMenuOption f2 in HelicoptersArrivalActionUtility.GetFloatMenuOptions <TransportPodsArrivalAction_AttackSettlement>(() => TransportPodsArrivalAction_AttackSettlement.CanAttack(pods, settlement), () => new TransportPodsArrivalAction_AttackSettlement(settlement, PawnsArrivalModeDefOf.CenterDrop), "AttackAndDropInCenter".Translate(settlement.Label), representative, settlement.Tile, car))
     {
         yield return(f2);
     }
     yield break;
 }
        public static IEnumerable <FloatMenuOption> GetVisitSite(
            CompLaunchableHelicopter representative,
            IEnumerable <IThingHolder> pods,
            Site site,
            Caravan car)
        {
            foreach (FloatMenuOption floatMenuOption in HelicoptersArrivalActionUtility.GetFloatMenuOptions <TransportPodsArrivalAction_VisitSite>((Func <FloatMenuAcceptanceReport>)(() => TransportPodsArrivalAction_VisitSite.CanVisit(pods, site)), (Func <TransportPodsArrivalAction_VisitSite>)(() => new TransportPodsArrivalAction_VisitSite(site, PawnsArrivalModeDefOf.EdgeDrop)), "DropAtEdge".Translate(), representative, site.Tile, car))
            {
                FloatMenuOption f = floatMenuOption;
                yield return(f);

                f = (FloatMenuOption)null;
            }
            foreach (FloatMenuOption floatMenuOption in HelicoptersArrivalActionUtility.GetFloatMenuOptions <TransportPodsArrivalAction_VisitSite>((Func <FloatMenuAcceptanceReport>)(() => TransportPodsArrivalAction_VisitSite.CanVisit(pods, site)), (Func <TransportPodsArrivalAction_VisitSite>)(() => new TransportPodsArrivalAction_VisitSite(site, PawnsArrivalModeDefOf.CenterDrop)), "DropInCenter".Translate(), representative, site.Tile, car))
            {
                FloatMenuOption f2 = floatMenuOption;
                yield return(f2);

                f2 = (FloatMenuOption)null;
            }
        }
Esempio n. 8
0
        public static IEnumerable <FloatMenuOption> GetSettle(Settlement bs, IEnumerable <IThingHolder> pods, CompLaunchableHelicopter representative, Caravan car)
        {
            foreach (FloatMenuOption o in GetMapParent(bs, pods, representative, car))
            {
                yield return(o);
            }

            foreach (FloatMenuOption f in HelicoptersArrivalActionUtility.GetVisitFloatMenuOptions(representative, pods, bs, car))
            {
                yield return(f);
            }

            foreach (FloatMenuOption f2 in HelicoptersArrivalActionUtility.GetGIFTFloatMenuOptions(representative, pods, bs, car))
            {
                yield return(f2);
            }
            foreach (FloatMenuOption f3 in HelicoptersArrivalActionUtility.GetATKFloatMenuOptions(representative, pods, bs, car))
            {
                yield return(f3);
            }
            yield break;
        }