import * as Types from '../../../../types/world/worldTypes';
import addAisleToScene from './addAilseToScene';
import * as CONSTANTS from '../../../../types/world/worldConstants';

export default async function loadAisles(
    lines: Types.RefLines,
    floorGroupAisle: Types.RefGroup
) {
    // console.log('lines: ', lines.current[0][0][0]);
    if (!floorGroupAisle.current) return
    floorGroupAisle.current.children = [];
    const aisles = lines.current.filter((line) => line[0][3] && line[1][3] === CONSTANTS.lineConfig.aisleName);

    if (aisles.length > 0) {
        aisles.forEach((aisle: Types.Line) => {
            addAisleToScene(aisle, floorGroupAisle)
        })
    }
}