|
|
Line 3: |
Line 3: |
| local Utils = require('Module:Utils') | | local Utils = require('Module:Utils') |
|
| |
|
| function p.listBiomes(frame) | | function p.main(biome) |
| local args = Utils.normaliseArgs(frame)
| |
| return p.renderBiomeList(args.type)
| |
| end
| |
| | |
| function p.renderBiomeList(biomeType, includeSubBiomes)
| |
| local biomeData = require("Module:BiomeData") | | local biomeData = require("Module:BiomeData") |
| ---@type boolean
| |
| local isLand
| |
| if biomeType == 'Land' then
| |
| isLand = true
| |
| elseif biomeType == 'Water' then
| |
| isLand = false
| |
| end
| |
|
| |
| local biomes = {}
| |
| for _, biome in pairs(biomeData) do
| |
| if biome.Name ~= '' and (isLand == nil or biome.Land == isLand) and (includeSubBiomes ~= true or biome.MainBiome == '') then
| |
| biomes[#biomes + 1] = "* [[" .. biome.Name .. "]]"
| |
| end
| |
| end
| |
| table.sort(biomes)
| |
|
| |
|
| return table.concat(biomes, "\n") | | return "\n"; |
| end | | end |
|
| |
|
| return p | | return p |
local p = {}
local Utils = require('Module:Utils')
function p.main(biome)
local biomeData = require("Module:BiomeData")
return "\n";
end
return p