private static void SyncAttackSettlement(SyncWorker sync, ref TransportPodsArrivalAction_AttackSettlement transportPodAction)
 {
     if (sync.isWriting)
     {
         sync.Write((Settlement)attackSettlementField.GetValue(transportPodAction));
         sync.Write((PawnsArrivalModeDef)attackSettlementArrivalModeField.GetValue(transportPodAction));
     }
     else
     {
         transportPodAction = new TransportPodsArrivalAction_AttackSettlement(sync.Read <Settlement>(), sync.Read <PawnsArrivalModeDef>());
     }
 }
        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;
            }
        }
Example #3
0
 public static IEnumerable <FloatMenuOption> GetATKFloatMenuOptions(CompDropship representative, IEnumerable <IThingHolder> pods, Settlement settlement, Caravan car)
 {
     foreach (FloatMenuOption f in DropShipArrivalActionUtility.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 DropShipArrivalActionUtility.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;
 }
 private static void SyncAttackSettlement(ThingComp compLaunchableSrts, int destinationTile, TransportPodsArrivalAction_AttackSettlement arrivalAction, Caravan caravanMethodParameter, Caravan caravanFieldValue)
 => SyncedUniversalArrivalAction(compLaunchableSrts, destinationTile, arrivalAction, caravanMethodParameter, caravanFieldValue);