Example #1
0
 public void Notify_Loaded(Pawn pawnToLoad)
 {
     if (this.bills != null & this.bills.Count > 0)
     {
         Bill_LoadVehicle bill = this.bills.FirstOrDefault((x) => x.pawnToLoad == pawnToLoad);
         if (bill != null)
         {
             pawnToLoad.DeSpawn();
             bill.group.handlers.Add(pawnToLoad);
             this.bills.Remove(bill);
         }
     }
 }
Example #2
0
        public void GiveLoadJob(Thing thingToLoad, VehicleHandlerGroup group)
        {
            if (thingToLoad is Pawn pawn)
            {
                Job newJob = new Job(DefDatabase <JobDef> .GetNamed("CompVehicle_LoadPassenger"), this.Pawn);
                pawn.jobs.TryTakeOrderedJob(newJob);

                if (this.bills != null && this.bills.Count > 0)
                {
                    Bill_LoadVehicle bill = this.bills.FirstOrDefault((Bill_LoadVehicle x) => x.pawnToLoad == pawn);
                    if (bill != null)
                    {
                        bill.group = group;
                        return;
                    }
                }
                this.bills.Add(new Bill_LoadVehicle(pawn, this.Pawn, group));
            }
        }