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