INNER CODE UNIT · TypeScript

forEachCell

LBALab/lba2remake · src/game/scenery/isometric/metadata/index.ts:125

function forEachCell(grid, metadata, handler) {
    let c = 0;
    const { layouts } = grid.library;
    const mdLayouts = metadata.layouts;
    for (let z = 0; z < 64; z += 1) {
        for (let x = 0; x < 64; x += 1) {
            const cell = grid.cells[c];
            const blocks = cell.blocks;
            for (let y = 0; y < blocks.length; y += 1) {
                const bly = blocks[y];
                if (bly) {
                    const layout = layouts[bly.layout];
                    if (layout && layout.index in mdLayouts) {
                        handler(mdLayouts[layout.index], layout, x, y, z);
                    }
                }
            }
            c += 1;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…