public static void AddAllowedAdjacentRegions(LocalTargetInfo dest, TraverseParms traverseParams, Map map, List <Region> regions)
        {
            GenAdj.GetAdjacentCorners(dest, out IntVec3 BL, out IntVec3 TL, out IntVec3 TR, out IntVec3 BR);
            if (!dest.HasThing || (dest.Thing.def.size.x == 1 && dest.Thing.def.size.z == 1))
            {
                IntVec3 cell = dest.Cell;
                for (int i = 0; i < 8; i++)
                {
                    IntVec3 intVec = GenAdj.AdjacentCells[i] + cell;
                    if (intVec.InBounds(map) && !IsAdjacentCornerAndNotAllowed(intVec, BL, TL, TR, BR, map))
                    {
                        Region region = intVec.GetRegion(map);
                        if (region != null && region.Allows(traverseParams, isDestination: true))
                        {
                            regions.Add(region);
                        }
                    }
                }
                return;
            }
            List <IntVec3> list = GenAdjFast.AdjacentCells8Way(dest);

            for (int j = 0; j < list.Count; j++)
            {
                if (list[j].InBounds(map) && !IsAdjacentCornerAndNotAllowed(list[j], BL, TL, TR, BR, map))
                {
                    Region region2 = list[j].GetRegion(map);
                    if (region2 != null && region2.Allows(traverseParams, isDestination: true))
                    {
                        regions.Add(region2);
                    }
                }
            }
        }
 public static void AddAllowedAdjacentRegions(LocalTargetInfo dest, TraverseParms traverseParams, Map map, List <VehicleRegion> regions)
 {
     GenAdj.GetAdjacentCorners(dest, out IntVec3 bl, out IntVec3 tl, out IntVec3 tr, out IntVec3 br);
     if (!dest.HasThing || (dest.Thing.def.size.x == 1 && dest.Thing.def.size.z == 1))
     {
         IntVec3 cell = dest.Cell;
         for (int i = 0; i < 8; i++)
         {
             IntVec3 intVec = GenAdj.AdjacentCells[i] + cell;
             if (intVec.InBoundsShip(map) && !TouchPathEndModeUtility.IsAdjacentCornerAndNotAllowed(intVec, bl, tl, tr, br, map))
             {
                 VehicleRegion region = VehicleGridsUtility.GetRegion(intVec, map, RegionType.Set_Passable);
                 if (region != null && region.Allows(traverseParams, true))
                 {
                     regions.Add(region);
                 }
             }
         }
     }
     else
     {
         List <IntVec3> list = GenAdjFast.AdjacentCells8Way(dest);
         for (int j = 0; j < list.Count; j++)
         {
             if (list[j].InBoundsShip(map) && !TouchPathEndModeUtility.IsAdjacentCornerAndNotAllowed(list[j], bl, tl, tr, br, map))
             {
                 VehicleRegion region2 = VehicleGridsUtility.GetRegion(list[j], map, RegionType.Set_Passable);
                 if (region2 != null && region2.Allows(traverseParams, true))
                 {
                     regions.Add(region2);
                 }
             }
         }
     }
 }
 public static bool IsAdjacentOrInsideAndAllowedToTouch(IntVec3 root, LocalTargetInfo target, Map map)
 {
     GenAdj.GetAdjacentCorners(target, out IntVec3 BL, out IntVec3 TL, out IntVec3 TR, out IntVec3 BR);
     if (root.AdjacentTo8WayOrInside(target))
     {
         return(!IsAdjacentCornerAndNotAllowed(root, BL, TL, TR, BR, map));
     }
     return(false);
 }
 public static bool IsAdjacentOrInsideAndAllowedToTouch(IntVec3 root, LocalTargetInfo target, Map map)
 {
     IntVec3 b1;
     IntVec3 t1;
     IntVec3 tr;
     IntVec3 br;
     GenAdj.GetAdjacentCorners(target, out b1, out t1, out tr, out br);
     return root.AdjacentTo8WayOrInside(target) && !TouchPathEndModeUtilityShips.IsAdjacentCornerAndNotAllowed(root, b1, t1, tr, br, map);
 }
        public static bool IsAdjacentOrInsideAndAllowedToTouch(IntVec3 root, LocalTargetInfo target, Map map)
        {
            IntVec3 bL;
            IntVec3 tL;
            IntVec3 tR;
            IntVec3 bR;

            GenAdj.GetAdjacentCorners(target, out bL, out tL, out tR, out bR);
            return(root.AdjacentTo8WayOrInside(target) && !TouchPathEndModeUtility.IsAdjacentCornerAndNotAllowed(root, bL, tL, tR, bR, map));
        }
        public static void AddAllowedAdjacentRegions(LocalTargetInfo dest, TraverseParms traverseParams, Map map, List <Region> regions)
        {
            IntVec3 bL = default(IntVec3);
            IntVec3 tL = default(IntVec3);
            IntVec3 tR = default(IntVec3);
            IntVec3 bR = default(IntVec3);

            GenAdj.GetAdjacentCorners(dest, out bL, out tL, out tR, out bR);
            if (!dest.HasThing || (dest.Thing.def.size.x == 1 && dest.Thing.def.size.z == 1))
            {
                IntVec3 cell = dest.Cell;
                for (int i = 0; i < 8; i++)
                {
                    IntVec3 intVec = GenAdj.AdjacentCells[i] + cell;
                    if (intVec.InBounds(map) && !TouchPathEndModeUtility.IsAdjacentCornerAndNotAllowed(intVec, bL, tL, tR, bR, map))
                    {
                        Region region = intVec.GetRegion(map, RegionType.Set_Passable);
                        if (region != null && region.Allows(traverseParams, true))
                        {
                            regions.Add(region);
                        }
                    }
                }
            }
            else
            {
                List <IntVec3> list = GenAdjFast.AdjacentCells8Way(dest);
                for (int j = 0; j < list.Count; j++)
                {
                    if (list[j].InBounds(map) && !TouchPathEndModeUtility.IsAdjacentCornerAndNotAllowed(list[j], bL, tL, tR, bR, map))
                    {
                        Region region2 = list[j].GetRegion(map, RegionType.Set_Passable);
                        if (region2 != null && region2.Allows(traverseParams, true))
                        {
                            regions.Add(region2);
                        }
                    }
                }
            }
        }
 public static bool IsAdjacentOrInsideAndAllowedToTouch(IntVec3 root, LocalTargetInfo target, Map map)
 {
     GenAdj.GetAdjacentCorners(target, out IntVec3 b1, out IntVec3 t1, out IntVec3 tr, out IntVec3 br);
     return(root.AdjacentTo8WayOrInside(target) && !IsAdjacentCornerAndNotAllowed(root, b1, t1, tr, br, map));
 }