예제 #1
0
        private void CancelLoadingProcess()
        {
            List <Thing> list = this.lord.Map.listerThings.ThingsInGroup(ThingRequestGroup.Transporter);

            for (int i = 0; i < list.Count; i++)
            {
                CompTransporter compTransporter = list[i].TryGetComp <CompTransporter>();
                if (compTransporter.groupID == this.transportersGroup)
                {
                    compTransporter.CancelLoad();
                    break;
                }
            }
        }
        public static void SendAway(Thing shuttle, bool dropEverything)
        {
            CompShuttle     compShuttle     = shuttle.TryGetComp <CompShuttle>();
            CompTransporter compTransporter = shuttle.TryGetComp <CompTransporter>();

            if (shuttle.Spawned)
            {
                if (dropEverything && compTransporter.LoadingInProgressOrReadyToLaunch)
                {
                    compTransporter.CancelLoad();
                }
                if (!compTransporter.LoadingInProgressOrReadyToLaunch)
                {
                    TransporterUtility.InitiateLoading(Gen.YieldSingle(compTransporter));
                }
                compShuttle.Send();
            }
            else if (shuttle.ParentHolder is Thing && ((Thing)shuttle.ParentHolder).def == ThingDefOf.ShuttleIncoming)
            {
                compShuttle.leaveASAP = true;
            }
        }