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