Module:TestTableau : Différence entre versions

De X-Wing 2.0 - Le wiki des figurines
Aller à : navigation, rechercher
 
(3 révisions intermédiaires par le même utilisateur non affichées)
Ligne 3 : Ligne 3 :
 
local Data = {}
 
local Data = {}
 
local DataSSTab1 = mw.loadData('Module:TestTableau/SSTab1')
 
local DataSSTab1 = mw.loadData('Module:TestTableau/SSTab1')
local DataSSTab1 = mw.loadData('Module:TestTableau/SSTab2')
+
local DataSSTab2 = mw.loadData('Module:TestTableau/SSTab2')
 
Data["SSTab1"] = DataSSTab1
 
Data["SSTab1"] = DataSSTab1
 
Data["SSTab2"] = DataSSTab2
 
Data["SSTab2"] = DataSSTab2
  
 
+
local DataDonneeJeu = mw.loadData('Module:Donnees jeu/Data')
  
 
function tprint(t)  
 
function tprint(t)  
Ligne 19 : Ligne 19 :
 
       end
 
       end
 
       if type(value) == "table" then
 
       if type(value) == "table" then
           tprint(value)
+
           retour = retour .. "--T-- ".. key .. "\n" .. tprint(value)
 
       else
 
       else
 
           retour = retour .. "-- " .. key .. "?" .. value .. "\n"
 
           retour = retour .. "-- " .. key .. "?" .. value .. "\n"
Ligne 28 : Ligne 28 :
  
 
function p.affichage(frame)
 
function p.affichage(frame)
     return tprint(Data)
+
     return tprint(DataDonneeJeu)
 
end
 
end
  
 
return p
 
return p

Version actuelle datée du 26 juillet 2019 à 11:39

La documentation pour ce module peut être créée à Module:TestTableau/doc

local p = {}

local Data = {}
local DataSSTab1 = mw.loadData('Module:TestTableau/SSTab1')
local DataSSTab2 = mw.loadData('Module:TestTableau/SSTab2')
Data["SSTab1"] = DataSSTab1
Data["SSTab2"] = DataSSTab2

local DataDonneeJeu = mw.loadData('Module:Donnees jeu/Data')

function tprint(t) 
   local retour = ""   
   for key,value in pairs(t) do
       if key == nil then
           key = "Null"
       end
       if value == nil then
           value = "Null"
       end
       if type(value) == "table" then
           retour = retour .. "--T-- ".. key .. "\n" .. tprint(value)
       else
           retour = retour .. "-- " .. key .. "?" .. value .. "\n"
       end
   end
   return retour
end

function p.affichage(frame)
    return tprint(DataDonneeJeu)
end

return p