public static Region GetRegion(this Thing thing, RegionType allowedRegionTypes = RegionType.Set_Passable) { if (!thing.Spawned) { return null; } return RegionAndRoomQuery.RegionAt(thing.Position, thing.Map, allowedRegionTypes); }
public static Room RoomAt(IntVec3 c, Map map, RegionType allowedRegionTypes = RegionType.Set_Passable) { Region region = RegionAndRoomQuery.RegionAt(c, map, allowedRegionTypes); return (region == null) ? null : region.Room; }