--- @alias Procedural "flower_plains"

--- @param template Procedural
local function new(template, size)
    local map = {}
    -- паттерн-матчинг для самых маленьких
    if template == "flower_plains" then
        local tileMap = require("lib.utils.sprite_atlas").load(Tree.assets.files.tiles.grass)
        for y = 0, size.y - 1 do
            for x = 0, size.x - 1 do
                local tile = require('lib.level.tile').new { quad = tileMap:pickQuad("flower_grass"), atlas = tileMap.atlas }
                    :copyWith({ position = Vec3 { x, y } })
                map[tostring(tile.position)] = tile
            end
        end
    end
    return map
end

return { new = new }
