コード例 #1
0
 public static Room GetRoom(this Thing thing, RegionType allowedRegionTypes = RegionType.Set_Passable)
 {
     if (!thing.Spawned)
     {
         return(null);
     }
     return(RegionAndRoomQuery.RoomAt(thing.Position, thing.Map, allowedRegionTypes));
 }
コード例 #2
0
        public static Room GetRoom(this Thing thing, RegionType allowedRegionTypes = RegionType.Set_Passable)
        {
            Room result;

            if (!thing.Spawned)
            {
                result = null;
            }
            else
            {
                result = RegionAndRoomQuery.RoomAt(thing.Position, thing.Map, allowedRegionTypes);
            }
            return(result);
        }
コード例 #3
0
        public static Room RoomAtOrAdjacent(IntVec3 c, Map map, RegionType allowedRegionTypes = RegionType.Set_Passable)
        {
            Room room = RegionAndRoomQuery.RoomAt(c, map, allowedRegionTypes);

            if (room != null)
            {
                return(room);
            }
            for (int i = 0; i < 8; i++)
            {
                IntVec3 c2 = c + GenAdj.AdjacentCells[i];
                room = RegionAndRoomQuery.RoomAt(c2, map, allowedRegionTypes);
                if (room != null)
                {
                    return(room);
                }
            }
            return(room);
        }
コード例 #4
0
 public static Room GetRoom(this IntVec3 loc, Map map, RegionType allowedRegionTypes = RegionType.Set_Passable)
 {
     return(RegionAndRoomQuery.RoomAt(loc, map, allowedRegionTypes));
 }
コード例 #5
0
        public static RoomGroup RoomGroupAt(IntVec3 c, Map map)
        {
            Room room = RegionAndRoomQuery.RoomAt(c, map, RegionType.Set_All);

            return((room == null) ? null : room.Group);
        }