106 640
contributi
m (Te pareva se mw.loadData non faceva esplodere tutto) |
(Taking care of Pokémon in both forms data modules while merging *** sovrascritto il testo esistente ***) |
||
local tab = require('Modulo:Wikilib/tables')
local alt = mw.loadData('Modulo:AltForms/data')
--[[
Unisce le tabelle AltForms/data e UselessForms/data
gestendo anche la presenza di Pokémon in entrambi.
Restituisce la tabella così creata
--]]
f.allFormsData = function()
local all = mw.clone(alt)
--[[
No need for ipairs because integer keys
are used only to index Pokémon by ndex
--]]
if all[k] then
--[[
This Pokémon is in both useless and altForms
Right now only Pikachu
--]]
all[k] = table.recursiveMerge(all[k], v)
--[[
gamesOrder is a pain in the neck
right now, with Pikachu, it is possible to
simply concatenate the two tables and remove
the second 'base'
--]]
all[k].gamesOrder = table.noDuplicates(table.merge(
all[k].gamesOrder, v.gamesOrder))
else
end▼
end
return all
end
f.allformsdata, f.all_forms_data =
f.allFormsData, f.allFormsData
--[[
Se merge è false usa come modulo dati
per le forme alternative UselessForms/data,
se è true li usa entrambi.
Gestisce anche Pikachu, unico Pokémon presente
in entrambi i moduli dati.
--]]
f.loadUseless = function(merge)
if merge then
alt =
▲ local useless = mw.loadData('Modulo:UselessForms/data')
▲ for k, v in pairs(useless) do
▲ alt[k] = v
▲ end
else
alt = mw.loadData('Modulo:UselessForms/data')
end
f.getndexform, f.get_ndex_form =
-- Converte la sigla vuota in 'base'
end
f.tobase, f.to_base = f.toBase, f.toBase
-- Converte la sigla 'base' nella sigla vuota
end
▲f.toEmptyAbbr, f.toEmptyAbbr, f.toEmptyAbbr
--[[
|