Example #1
0
        //BorderCells

        //Owners
        //ContainedBeds
        //Fogged
        //IsDoorway
        //ContainedAndAdjacentThings
        //Role

        public static WaterRoom MakeNew(Map map)
        {
            WaterRoom room = new WaterRoom();

            room.mapIndex = (sbyte)map.Index;
            room.ID       = WaterRoom.nextRoomID;
            WaterRoom.nextRoomID++;
            return(room);
        }
        public static WaterRoom RoomAtOrAdjacent(IntVec3 c, Map map, RegionType allowedRegionTypes = RegionType.Set_Passable)
        {
            WaterRoom room = WaterRegionAndRoomQuery.RoomAt(c, map, allowedRegionTypes);

            if (!(room is null))
            {
                return(room);
            }
            for (int i = 0; i < 8; i++)
            {
                IntVec3 c2 = c + GenAdj.AdjacentCells[i];
                room = WaterRegionAndRoomQuery.RoomAt(c2, map, allowedRegionTypes);
                if (!(room is null))
                {
                    return(room);
                }
            }
            return(room);
        }