     }
 
     func shift(westOf x: Int, distance: Int) {
+        xRange = xRange.lowerBound - distance ..< xRange.upperBound
+
         let oldMapElementsByPosition = mapElementsByPosition
         
         for (oldPosition, element) in oldMapElementsByPosition {

    }
    
    func debugPrint() {
        var minX = 0
        var maxX = 0
        var minY = 0
        var maxY = 0
        var minPlane = 0
        var maxPlane = 0
        for (position, _) in mapElementsByPosition {
            minX = min(minX, position.x)
            maxX = max(maxX, position.x)
            minY = min(minY, position.y)
            maxY = max(maxY, position.y)
            minPlane = min(minPlane, position.plane)
            maxPlane = max(maxPlane, position.plane)
        }

        let elementWidth = 14

        let width = maxX - minX + 1
        let height = maxY - minY + 1
        let fillLine = [String](repeating: " ".padding(toLength: elementWidth, withPad: " ", startingAt: 0), count: width)
        var grid = [[String]](repeating: fillLine, count: height)
        
        for (position, element) in mapElementsByPosition {
            let atX = position.x - minX
            let atY = position.y - minY
            switch element {

            if mapElementsByPosition[toPosition] != nil {
                shift(northOf: fromPosition.y, distance: 1)
            }
            add(room: toRoom, position: toPosition)
            return .didAddRoom
        case .south:
            let toPosition = fromPosition.adjustedBy(y: 1)
            if mapElementsByPosition[toPosition] != nil {
                shift(southOf: fromPosition.y, distance: 1)
            }
            add(room: toRoom, position: toPosition)
            return .didAddRoom
        case .west:
            let toPosition = fromPosition.adjustedBy(x: -1)
            if mapElementsByPosition[toPosition] != nil {
                shift(westOf: fromPosition.x, distance: 1)
            }
            add(room: toRoom, position: toPosition)
            return .didAddRoom
        case .east:
            let toPosition = fromPosition.adjustedBy(x: 1)
            if mapElementsByPosition[toPosition] != nil {
                shift(eastOf: fromPosition.x, distance: 1)
            }
            add(room: toRoom, position: toPosition)
            return .didAddRoom
        case .up:
            // TODO
