Esempio n. 1
0
        private Job TryStartNewDoBillJob(Pawn pawn, ActivityTask task, Building_ReligiousBuildingFacility giver)
        {
            Job job1 = HaulStuffOffBillGiverJob(pawn, giver, (Thing)null);

            if (job1 != null)
            {
                return(job1);
            }
            ActivityJob job2 = new ActivityJob()
            {
                def     = MiscDefOf.DoReligionActivity,
                targetA = (LocalTargetInfo)((Thing)giver)
            };

            job2.targetQueueB = new List <LocalTargetInfo>(this.chosenIngThings.Count);
            job2.countQueue   = new List <int>(this.chosenIngThings.Count);
            for (int index = 0; index < this.chosenIngThings.Count; ++index)
            {
                job2.targetQueueB.Add((LocalTargetInfo)this.chosenIngThings[index].Thing);
                job2.countQueue.Add(this.chosenIngThings[index].Count);
            }
            job2.haulMode     = HaulMode.ToCellNonStorage;
            job2.activityTask = task;
            return(job2);
        }
        public Job GetCurrentJob(Pawn pawn)
        {
            if (activityCurrentStage >= data.ActivityJobs.Count())
            {
                return(null);
            }

            PawnDuty duty = pawn.mindState.duty;

            if (duty == null)
            {
                return((Job)null);
            }

            if (signalsCounted[pawn] == true)
            {
                return((Job)null);
            }

            JobDef def;

            if (pawn == data.Organizer)
            {
                def = data.ActivityJobs.ElementAt(activityCurrentStage).OrganizerJob;
            }
            else
            {
                def = data.ActivityJobs.ElementAt(activityCurrentStage).CongregationJob;
            }

            Job job = (Job)null;

            if (def != null)
            {
                if (pawn == data.Organizer)
                {
                    job = new ActivityJob()
                    {
                        def          = data.ActivityJobs.ElementAt(activityCurrentStage).OrganizerJob,
                        targetA      = data.Facility,
                        activityTask = data.Task
                    };
                    OrganizerReserve(pawn, job);
                }
                else
                {
                    job = new Job(data.ActivityJobs.ElementAt(activityCurrentStage).CongregationJob, data.Facility);
                }
            }

            return(job);
        }