public override bool HasJobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            if (!(t is Fire fire))
            {
                return(false);
            }

            if (fire.parent is Pawn pawn2)
            {
                if (pawn2 == pawn)
                {
                    return(false);
                }

                if ((pawn2.Faction == pawn.Faction || pawn2.HostFaction == pawn.Faction ||
                     pawn2.HostFaction == pawn.HostFaction) && !pawn.Map.areaManager.Home[fire.Position] &&
                    IntVec3Utility.ManhattanDistanceFlat(pawn.Position, pawn2.Position) > MaxReservationCheckDistance)
                {
                    return(false);
                }

                if (!pawn.CanReach(pawn2, PathEndMode.Touch, Danger.Deadly))
                {
                    return(false);
                }
            }
            else
            {
                if (pawn.story.DisabledWorkTagsBackstoryAndTraits.OverlapsWithOnAnyWorkType(WorkTags.Firefighting))
                {
                    return(false);
                }

                if (!pawn.Map.areaManager.Home[fire.Position])
                {
                    JobFailReason.Is(WorkGiver_FixBrokenDownBuilding.NotInHomeAreaTrans);
                    return(false);
                }
            }

            if (Designator_AreaNoFireFighting.NoFireFightingArea(pawn.Map.areaManager)[fire.Position])
            {
                return(false);
            }

            if ((pawn.Position - fire.Position).LengthHorizontalSquared <=
                MaxReservationCheckDistance * NearbyPawnRadius)
            {
                return(!FireIsBeingHandled(fire, pawn));
            }

            LocalTargetInfo target = fire;

            if (!pawn.CanReserve(target, 1, -1, null, forced))
            {
                return(false);
            }

            return(!FireIsBeingHandled(fire, pawn));
        }
        public override bool HasJobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            Fire fire = t as Fire;

            if (fire == null)
            {
                return(false);
            }
            Pawn pawn2 = fire.parent as Pawn;

            if (pawn2 != null)
            {
                if (pawn2 == pawn)
                {
                    return(false);
                }
                if ((pawn2.Faction == pawn.Faction || pawn2.HostFaction == pawn.Faction || pawn2.HostFaction == pawn.HostFaction) && !pawn.Map.areaManager.Home[fire.Position] && IntVec3Utility.ManhattanDistanceFlat(pawn.Position, pawn2.Position) > MaxReservationCheckDistance)
                {
                    return(false);
                }
                if (!pawn.CanReach(pawn2, PathEndMode.Touch, Danger.Deadly, false, TraverseMode.ByPawn))
                {
                    return(false);
                }
            }
            else
            {
                if (pawn.story.WorkTagIsDisabled(WorkTags.Firefighting))
                {
                    return(false);
                }
                if (!pawn.Map.areaManager.Home[fire.Position])
                {
                    JobFailReason.Is(WorkGiver_FixBrokenDownBuilding.NotInHomeAreaTrans, null);
                    return(false);
                }
            }
            if (Designator_AreaNoFireFighting.NoFireFightingArea(pawn.Map.areaManager)[fire.Position])
            {
                return(false);
            }
            if ((pawn.Position - fire.Position).LengthHorizontalSquared > (MaxReservationCheckDistance * NearbyPawnRadius))
            {
                LocalTargetInfo target = fire;
                if (!pawn.CanReserve(target, 1, -1, null, forced))
                {
                    return(false);
                }
            }
            return(!WorkGiver_ExtendedFightFires.FireIsBeingHandled(fire, pawn));
        }
        public override AcceptanceReport CanDesignateCell(IntVec3 loc)
        {
            if (!loc.InBounds(base.Map))
            {
                return(false);
            }
            bool flag = Designator_AreaNoFireFighting.NoFireFightingArea(base.Map.areaManager)[loc];

            if (this.mode == DesignateMode.Add)
            {
                return(!flag);
            }
            return(flag);
        }
 public override void SelectedUpdate()
 {
     GenUI.RenderMouseoverBracket();
     Designator_AreaNoFireFighting.NoFireFightingArea(base.Map.areaManager).MarkForDraw();
 }
 public override void DesignateSingleCell(IntVec3 c)
 {
     Designator_AreaNoFireFighting.NoFireFightingArea(base.Map.areaManager)[c] = this.mode == DesignateMode.Add;
 }