コード例 #1
0
        public static IEnumerable <FloatMenuOption> GetATKFloatMenuOptions(
            CompLaunchableSRTS 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 SRTSArrivalActionUtility.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 SRTSArrivalActionUtility.GetFloatMenuOptions <TransportPodsArrivalAction_AttackSettlement>(acceptanceReportGetter2, arrivalActionGetter2, "AttackAndDropInCenter".Translate(objArray2), representative, settlement.Tile, car))
            {
                FloatMenuOption f2 = floatMenuOption;
                yield return(f2);

                f2 = (FloatMenuOption)null;
            }
        }
コード例 #2
0
 public static IEnumerable <FloatMenuOption> GetVisitFloatMenuOptions(
     CompLaunchableSRTS representative,
     IEnumerable <IThingHolder> pods,
     SettlementBase settlement,
     Caravan car)
 {
     return(SRTSArrivalActionUtility.GetFloatMenuOptions <TransportPodsArrivalAction_VisitSettlement>((Func <FloatMenuAcceptanceReport>)(() => TransportPodsArrivalAction_VisitSettlement.CanVisit(pods, settlement)), (Func <TransportPodsArrivalAction_VisitSettlement>)(() => new TransportPodsArrivalAction_VisitSettlement(settlement)), "VisitSettlement".Translate((object)settlement.Label), representative, settlement.Tile, car));
 }
コード例 #3
0
 public static IEnumerable <FloatMenuOption> GetGIFTFloatMenuOptions(CompLaunchableSRTS representative, IEnumerable <IThingHolder> pods, Settlement settlement, Caravan car)
 {
     if (settlement.Faction == Faction.OfPlayer)
     {
         return(Enumerable.Empty <FloatMenuOption>());
     }
     return(SRTSArrivalActionUtility.GetFloatMenuOptions <TransportPodsArrivalAction_GiveGift>((Func <FloatMenuAcceptanceReport>)(() => TransportPodsArrivalAction_GiveGift.CanGiveGiftTo(pods, settlement)), (Func <TransportPodsArrivalAction_GiveGift>)(() => new TransportPodsArrivalAction_GiveGift(settlement)), "GiveGiftViaTransportPods".Translate(settlement.Faction.Name, FactionGiftUtility.GetGoodwillChange(pods, settlement).ToStringWithSign()), representative, settlement.Tile, car));
 }
コード例 #4
0
        public static IEnumerable <FloatMenuOption> GetVisitSite(
            CompLaunchableSRTS representative,
            IEnumerable <IThingHolder> pods,
            Site site,
            Caravan car)
        {
            foreach (FloatMenuOption floatMenuOption in SRTSArrivalActionUtility.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 SRTSArrivalActionUtility.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;
            }
        }
コード例 #5
0
        public static IEnumerable <FloatMenuOption> GetSettle(
            Settlement bs,
            IEnumerable <IThingHolder> pods,
            CompLaunchableSRTS representative,
            Caravan car)
        {
            foreach (FloatMenuOption floatMenuOption in SRTSStatic.GetMapParent((MapParent)bs, pods, representative, car))
            {
                FloatMenuOption o = floatMenuOption;
                yield return(o);

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

                f = (FloatMenuOption)null;
            }
            /*Uncomment to allow gifting of Ship and contents to faction -SmashPhil*/

            /*foreach (FloatMenuOption giftFloatMenuOption in SRTSArrivalActionUtility.GetGIFTFloatMenuOptions(representative, pods, bs, car))
             * {
             * FloatMenuOption f2 = giftFloatMenuOption;
             * yield return f2;
             * f2 = (FloatMenuOption) null;
             * }*/
            foreach (FloatMenuOption atkFloatMenuOption in SRTSArrivalActionUtility.GetATKFloatMenuOptions(representative, pods, bs, car))
            {
                FloatMenuOption f3 = atkFloatMenuOption;
                yield return(f3);

                f3 = (FloatMenuOption)null;
            }
        }