コード例 #1
0
 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));
 }
コード例 #2
0
        public static Region GetRegion(this Thing thing, RegionType allowedRegionTypes = RegionType.Set_Passable)
        {
            Region result;

            if (!thing.Spawned)
            {
                result = null;
            }
            else
            {
                result = RegionAndRoomQuery.RegionAt(thing.Position, thing.Map, allowedRegionTypes);
            }
            return(result);
        }
コード例 #3
0
 public static Region GetRegion(this IntVec3 loc, Map map, RegionType allowedRegionTypes = RegionType.Set_Passable)
 {
     return(RegionAndRoomQuery.RegionAt(loc, map, allowedRegionTypes));
 }
コード例 #4
0
        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);
        }