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 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; IntVec3 tL; IntVec3 tR; IntVec3 bR; 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); } } } } }