// Token: 0x0600041B RID: 1051 RVA: 0x0002C940 File Offset: 0x0002AD40
        protected override Job TryGiveJob(Pawn pawn)
        {
            Room room = pawn.GetRoom(RegionType.Set_Passable);
            int  num  = 0;

            while ((float)num < JobGiver_MaintainHiveLikes.CellsInScanRadius)
            {
                IntVec3 intVec = pawn.Position + GenRadial.RadialPattern[num];
                if (intVec.InBounds(pawn.Map))
                {
                    if (intVec.GetRoom(pawn.Map, RegionType.Set_Passable) == room)
                    {
                        HiveLike hivelike = (HiveLike)pawn.Map.thingGrid.ThingAt(intVec, ThingDefOf.Hive);
                        if (hivelike != null && pawn.CanReserve(hivelike, 1, -1, null, false))
                        {
                            CompMaintainable compMaintainable = hivelike.TryGetComp <CompMaintainable>();
                            if (compMaintainable.CurStage != MaintainableStage.Healthy)
                            {
                                if (!this.onlyIfDamagingState || compMaintainable.CurStage == MaintainableStage.Damaging)
                                {
                                    return(new Job(JobDefOf.Maintain, hivelike));
                                }
                            }
                        }
                    }
                }
                num++;
            }
            return(null);
        }
        // Token: 0x0600041B RID: 1051 RVA: 0x0002C940 File Offset: 0x0002AD40
        protected override Job TryGiveJob(Pawn pawn)
        {
            ThingDef hiveDef = null;
            List <ThingDef_HiveLike> hivedefs = DefDatabase <ThingDef_HiveLike> .AllDefsListForReading.FindAll(x => x.Faction == pawn.Faction.def);

            foreach (ThingDef_HiveLike hivedef in hivedefs)
            {
                if (pawn.jobs.debugLog)
                {
                    pawn.jobs.DebugLogEvent(string.Format("JobGiver_MaintainHiveLikes found hiveDef: {0} for {1}", hiveDef, pawn));
                }
                if (hivedef.Faction == pawn.Faction.def)
                {
                    hiveDef = hivedef;
                    if (pawn.jobs.debugLog)
                    {
                        pawn.jobs.DebugLogEvent(string.Format("JobGiver_MaintainHiveLikes set hiveDef: {0} for {1}", hiveDef, pawn));
                    }
                    break;
                }
            }
            Room room = pawn.GetRoom(RegionType.Set_Passable);
            int  num  = 0;

            while ((float)num < JobGiver_MaintainHiveLikes.CellsInScanRadius)
            {
                IntVec3 intVec = pawn.Position + GenRadial.RadialPattern[num];
                if (intVec.InBounds(pawn.Map))
                {
                    if (intVec.GetRoom(pawn.Map, RegionType.Set_Passable) == room)
                    {
                        HiveLike hivelike = (HiveLike)pawn.Map.thingGrid.ThingAt(intVec, hiveDef);
                        if (hivelike != null && pawn.CanReserve(hivelike, 1, -1, null, false))
                        {
                            CompMaintainableLike compMaintainable = hivelike.TryGetComp <CompMaintainableLike>();
                            if (compMaintainable != null && compMaintainable.CurStage != MaintainableStage.Healthy)
                            {
                                if (!this.onlyIfDamagingState || compMaintainable.CurStage == MaintainableStage.Damaging)
                                {
                                    return(new Job(XenomorphDefOf.RRY_Job_Xenomorph_MaintainHive, hivelike));
                                }
                            }
                        }
                    }
                }
                num++;
            }
            return(null);
        }