예제 #1
0
        public override FloatMenuAcceptanceReport StillValid(IEnumerable <IThingHolder> pods, int destinationTile)
        {
            FloatMenuAcceptanceReport floatMenuAcceptanceReport = base.StillValid(pods, destinationTile);

            if (!floatMenuAcceptanceReport)
            {
                return(floatMenuAcceptanceReport);
            }
            return(TransportPodsArrivalAction_FormCaravan.CanFormCaravanAt(pods, destinationTile));
        }
 private void Arrived()
 {
     if (this.arrived)
     {
         return;
     }
     this.arrived = true;
     if (this.arrivalAction == null || !this.arrivalAction.StillValid(this.pods.Cast <IThingHolder>(), this.destinationTile))
     {
         this.arrivalAction = null;
         List <Map> maps = Find.Maps;
         for (int i = 0; i < maps.Count; i++)
         {
             if (maps[i].Tile == this.destinationTile)
             {
                 this.arrivalAction = new TransportPodsArrivalAction_LandInSpecificCell(maps[i].Parent, DropCellFinder.RandomDropSpot(maps[i]));
                 break;
             }
         }
         if (this.arrivalAction == null)
         {
             if (TransportPodsArrivalAction_FormCaravan.CanFormCaravanAt(this.pods.Cast <IThingHolder>(), this.destinationTile))
             {
                 this.arrivalAction = new TransportPodsArrivalAction_FormCaravan();
             }
             else
             {
                 List <Caravan> caravans = Find.WorldObjects.Caravans;
                 for (int j = 0; j < caravans.Count; j++)
                 {
                     if (caravans[j].Tile == this.destinationTile && TransportPodsArrivalAction_GiveToCaravan.CanGiveTo(this.pods.Cast <IThingHolder>(), caravans[j]))
                     {
                         this.arrivalAction = new TransportPodsArrivalAction_GiveToCaravan(caravans[j]);
                         break;
                     }
                 }
             }
         }
     }
     if (this.arrivalAction != null && this.arrivalAction.ShouldUseLongEvent(this.pods, this.destinationTile))
     {
         LongEventHandler.QueueLongEvent(delegate()
         {
             this.DoArrivalAction();
         }, "GeneratingMapForNewEncounter", false, null);
     }
     else
     {
         this.DoArrivalAction();
     }
 }