public static IEnumerable <Thing> AllSendableItems_NewTmp(List <CompTransporter> transporters, Map map, bool autoLoot)
        {
            List <Thing> items   = CaravanFormingUtility.AllReachableColonyItems(map, canMinify: autoLoot, allowEvenIfOutsideHomeArea: autoLoot, allowEvenIfReserved: transporters[0].Props.canChangeAssignedThingsAfterStarting && transporters[0].LoadingInProgressOrReadyToLaunch);
            CompShuttle  shuttle = transporters[0].parent.TryGetComp <CompShuttle>();

            for (int i = 0; i < items.Count; i++)
            {
                if (shuttle == null || shuttle.IsRequired(items[i]) || shuttle.IsAllowed(items[i]))
                {
                    yield return(items[i]);
                }
            }
        }
Esempio n. 2
0
        public static IEnumerable <Pawn> AllSendablePawns(List <CompTransporter> transporters, Map map)
        {
            CompShuttle shuttle = transporters[0].parent.TryGetComp <CompShuttle>();
            int         allowLoadAndEnterTransportersLordForGroupID = (transporters[0].Props.canChangeAssignedThingsAfterStarting && transporters[0].LoadingInProgressOrReadyToLaunch) ? transporters[0].groupID : (-1);
            List <Pawn> pawns = CaravanFormingUtility.AllSendablePawns(map, allowEvenIfDowned: true, allowEvenIfInMentalState: false, allowEvenIfPrisonerNotSecure: false, allowCapturableDownedPawns: false, shuttle != null, allowLoadAndEnterTransportersLordForGroupID);

            for (int i = 0; i < pawns.Count; i++)
            {
                if (shuttle == null || shuttle.IsRequired(pawns[i]) || shuttle.IsAllowed(pawns[i]))
                {
                    yield return(pawns[i]);
                }
            }
        }
        public static IEnumerable <Pawn> AllSendablePawns_NewTmp(List <CompTransporter> transporters, Map map, bool autoLoot)
        {
            CompShuttle shuttle = transporters[0].parent.TryGetComp <CompShuttle>();
            int         allowLoadAndEnterTransportersLordForGroupID = ((transporters[0].Props.canChangeAssignedThingsAfterStarting && transporters[0].LoadingInProgressOrReadyToLaunch) ? transporters[0].groupID : (-1));
            bool        allowLodgers = shuttle != null;
            List <Pawn> pawns        = CaravanFormingUtility.AllSendablePawns(map, allowEvenIfDowned: true, autoLoot, autoLoot, autoLoot, allowLodgers, allowLoadAndEnterTransportersLordForGroupID);

            for (int i = 0; i < pawns.Count; i++)
            {
                if (shuttle == null || shuttle.IsRequired(pawns[i]) || shuttle.IsAllowed(pawns[i]))
                {
                    yield return(pawns[i]);
                }
            }
        }