protected override IEnumerable <Toil> MakeNewToils()
        {
            Vehicle_Cart cart = CurJob.GetTarget(CartInd).Thing as Vehicle_Cart;

            ///
            //Set fail conditions
            ///

            this.FailOnDestroyedOrNull(CartInd);
            //Note we only fail on forbidden if the target doesn't start that way
            //This helps haul-aside jobs on forbidden items
            if (!TargetThingA.IsForbidden(pawn.Faction))
            {
                this.FailOnForbidden(CartInd);
            }

            this.FailOn(() => !pawn.RaceProps.IsFlesh || !pawn.RaceProps.Humanlike);

            ///
            //Define Toil
            ///

            Toil findStoreCellForCart = Toils_Cart.FindStoreCellForCart(CartInd);
            Toil checkCartEmpty       = Toils_Jump.JumpIf(findStoreCellForCart, () => cart.storage.Count <= 0);


            Toil checkStoreCellEmpty = Toils_Jump.JumpIf(findStoreCellForCart, () => CurJob.GetTargetQueue(StoreCellInd).NullOrEmpty());
            Toil checkHaulableEmpty  = Toils_Jump.JumpIf(checkStoreCellEmpty, () => CurJob.GetTargetQueue(HaulableInd).NullOrEmpty());

            ///
            //Toils Start
            ///

            //Reserve thing to be stored and storage cell
            yield return(Toils_Reserve.Reserve(CartInd));

            yield return(Toils_Reserve.ReserveQueue(HaulableInd));

            yield return(Toils_Reserve.ReserveQueue(StoreCellInd));

            //JumpIf already mounted
            yield return(Toils_Jump.JumpIf(checkHaulableEmpty, () =>
            {
                if (cart.mountableComp.Driver == pawn)
                {
                    return true;
                }
                return false;
            }));

            //Mount on Target
            yield return(Toils_Goto.GotoThing(CartInd, PathEndMode.ClosestTouch)
                         .FailOnDestroyedOrNull(CartInd));

            yield return(Toils_Cart.MountOn(CartInd));

            //JumpIf checkStoreCellEmpty
            yield return(checkHaulableEmpty);

            //Collect TargetQueue
            {
                Toil extractA = Toils_Collect.Extract(HaulableInd);
                yield return(extractA);

                Toil gotoThing = Toils_Goto.GotoThing(HaulableInd, PathEndMode.ClosestTouch)
                                 .FailOnDestroyedOrNull(HaulableInd);
                yield return(gotoThing);

                yield return(Toils_Collect.CollectInCarrier(CartInd, HaulableInd));

                yield return(Toils_Collect.CheckDuplicates(gotoThing, CartInd, HaulableInd));

                yield return(Toils_Jump.JumpIfHaveTargetInQueue(HaulableInd, extractA));
            }

            //JumpIf findStoreCellForCart
            yield return(checkStoreCellEmpty);

            //Drop TargetQueue
            {
                yield return(checkCartEmpty);

                Toil extractB = Toils_Collect.Extract(StoreCellInd);
                yield return(extractB);

                Toil gotoCell = Toils_Goto.GotoCell(StoreCellInd, PathEndMode.ClosestTouch);
                yield return(gotoCell);

                yield return(Toils_Collect.DropTheCarriedInCell(StoreCellInd, ThingPlaceMode.Direct, CartInd));

                yield return(Toils_Jump.JumpIfHaveTargetInQueue(StoreCellInd, checkCartEmpty));

                yield return(Toils_Collect.CheckNeedStorageCell(gotoCell, CartInd, StoreCellInd));
            }

            yield return(findStoreCellForCart);

            yield return(Toils_Goto.GotoCell(StoreCellInd, PathEndMode.OnCell));

            yield return(Toils_Cart.DismountAt(CartInd, StoreCellInd));
        }
        protected override IEnumerable <Toil> MakeNewToils()
        {
            Apparel_Backpack backpack = this.CurJob.GetTarget(BackpackInd).Thing as Apparel_Backpack;

            ///
            // Set fail conditions
            ///
            // no free slots
            this.FailOn(() => backpack.SlotsComp.slots.Count >= backpack.MaxItem);

            //// hauling stuff not allowed
            // foreach (ThingCategoryDef category in CurJob.targetA.Thing.def.thingCategories)
            // {
            // this.FailOn(() => !backpack.slotsComp.Properties.allowedThingCategoryDefs.Contains(category));
            // this.FailOn(() => backpack.slotsComp.Properties.forbiddenSubThingCategoryDefs.Contains(category));
            // }


            ///
            // Define Toil
            ///

            Toil endOfJob = new Toil {
                initAction = () => { this.EndJobWith(JobCondition.Succeeded); }
            };
            Toil checkStoreCellEmpty = Toils_Jump.JumpIf(endOfJob, () => this.CurJob.GetTargetQueue(StoreCellInd).NullOrEmpty());
            Toil checkHaulableEmpty  = Toils_Jump.JumpIf(checkStoreCellEmpty, () => this.CurJob.GetTargetQueue(HaulableInd).NullOrEmpty());

            Toil checkBackpackEmpty = Toils_Jump.JumpIf(endOfJob, () => backpack.SlotsComp.slots.Count <= 0);

            ///
            // Toils Start
            ///

            // Reserve thing to be stored and storage cell
            yield return(Toils_Reserve.ReserveQueue(HaulableInd));

            yield return(Toils_Reserve.ReserveQueue(StoreCellInd));

            // JumpIf checkStoreCellEmpty
            yield return(checkHaulableEmpty);

            {
                // Collect TargetQueue
                Toil extractA = Toils_Collect.Extract(HaulableInd);
                yield return(extractA);

                Toil gotoThing = Toils_Goto.GotoThing(HaulableInd, PathEndMode.ClosestTouch)
                                 .FailOnDestroyedOrNull(HaulableInd);
                yield return(gotoThing);

                // yield return Toils_Collect.CollectInBackpack(HaulableInd, backpack);
                Toil pickUpThingIntoSlot = new Toil
                {
                    initAction = () =>
                    {
                        if (!backpack.SlotsComp.slots.TryAdd(this.CurJob.targetA.Thing))
                        {
                            this.EndJobWith(JobCondition.Incompletable);
                        }
                    }
                };
                yield return(pickUpThingIntoSlot);

                yield return(Toils_Collect.CheckDuplicates(gotoThing, BackpackInd, HaulableInd));

                yield return(Toils_Jump.JumpIfHaveTargetInQueue(HaulableInd, extractA));
            }

            // JumpIf toilEnd
            yield return(checkStoreCellEmpty);

            {
                // Drop TargetQueue
                yield return(checkBackpackEmpty);

                Toil extractB = Toils_Collect.Extract(StoreCellInd);
                yield return(extractB);

                Toil gotoCell = Toils_Goto.GotoCell(StoreCellInd, PathEndMode.ClosestTouch);
                yield return(gotoCell);

                yield return(Toils_Collect.DropTheCarriedFromBackpackInCell(StoreCellInd, ThingPlaceMode.Direct, backpack));

                yield return(Toils_Jump.JumpIfHaveTargetInQueue(StoreCellInd, checkBackpackEmpty));

                yield return(Toils_Collect.CheckNeedStorageCell(gotoCell, BackpackInd, StoreCellInd));
            }

            yield return(endOfJob);
        }
        protected override IEnumerable <Toil> MakeNewToils()
        {
            Vehicle_Cart cart   = CurJob.GetTarget(CartInd).Thing as Vehicle_Cart;
            Job          jobNew = new Job();

            ///
            //Set fail conditions
            ///

            this.FailOnDestroyedOrNull(CartInd);
            this.FailOn(() => !cart.mountableComp.IsMounted);
            //Note we only fail on forbidden if the target doesn't start that way
            //This helps haul-aside jobs on forbidden items
            if (!TargetThingA.IsForbidden(pawn.Faction))
            {
                this.FailOnForbidden(CartInd);
            }

            ///
            //Define Toil
            ///

            Toil releaseAnimalCart   = Toils_Cart.ReleaseAnimalCart(CartInd);
            Toil checkStoreCellEmpty = Toils_Jump.JumpIf(releaseAnimalCart, () => CurJob.GetTargetQueue(StoreCellInd).NullOrEmpty());
            Toil checkHaulableEmpty  = Toils_Jump.JumpIf(checkStoreCellEmpty, () => CurJob.GetTargetQueue(HaulableInd).NullOrEmpty());

            ///
            //Toils Start
            ///

            //Reserve thing to be stored and storage cell
            yield return(Toils_Reserve.Reserve(CartInd));

            yield return(Toils_Reserve.ReserveQueue(HaulableInd));

            yield return(Toils_Reserve.ReserveQueue(StoreCellInd));

            yield return(Toils_Goto.GotoThing(CartInd, PathEndMode.Touch)
                         .FailOn(() => cart.Destroyed || !cart.mountableComp.IsMounted));

            //JumpIf toilCheckStoreCellEmpty
            yield return(checkHaulableEmpty);

            //Collect TargetQueue
            {
                Toil extractA = Toils_Collect.Extract(HaulableInd);
                yield return(extractA);

                yield return(Toils_Cart.CallAnimalCart(CartInd, HaulableInd)
                             .FailOnDestroyedOrNull(HaulableInd));

                yield return(Toils_Goto.GotoThing(HaulableInd, PathEndMode.ClosestTouch)
                             .FailOnDestroyedOrNull(HaulableInd));

                yield return(Toils_Cart.CallAnimalCart(CartInd, HaulableInd, pawn)
                             .FailOnDestroyedOrNull(HaulableInd));

                yield return(Toils_Cart.WaitForAnimalCart(CartInd, HaulableInd));

                yield return(Toils_Collect.CollectInCarrier(CartInd, HaulableInd));

                yield return(Toils_Collect.CheckDuplicates(extractA, CartInd, HaulableInd));

                yield return(Toils_Jump.JumpIfHaveTargetInQueue(HaulableInd, extractA));
            }

            //JumpIf releaseAnimalCart
            yield return(checkStoreCellEmpty);

            //Drop TargetQueue
            {
                Toil extractB = Toils_Collect.Extract(StoreCellInd);
                yield return(extractB);

                yield return(Toils_Cart.CallAnimalCart(CartInd, StoreCellInd));

                yield return(Toils_Goto.GotoCell(StoreCellInd, PathEndMode.ClosestTouch)
                             .FailOnBurningImmobile(StoreCellInd));

                yield return(Toils_Cart.CallAnimalCart(CartInd, HaulableInd, pawn));

                yield return(Toils_Cart.WaitForAnimalCart(CartInd, HaulableInd));

                yield return(Toils_Collect.DropTheCarriedInCell(StoreCellInd, ThingPlaceMode.Direct, CartInd));

                yield return(Toils_Jump.JumpIfHaveTargetInQueue(StoreCellInd, extractB));
            }

            yield return(releaseAnimalCart);
        }