ФЭНДОМ


-- Worker module to extract the Levels data from Module:LuaDB --
 
-- PRIVATE (worker methods) -- working set for testing
 
local p = {}
 
local function _getWorld( index )
-- returns lua subtable containing indexed world
 
    local LevelsDb = 'Module:LuaDB' -- later may be split...
 
    return LevelsDb[index]
end
 
local function _getEpisode( t_world, index )
-- return subtable indexed episode 
    return t_world[index]
end
 
local function _formatWorld ( world, filter ) 
-- indexes lua table for single world, outputs MW table
-- output columns will be based on filter (none or specific level type)
 
-- Maths for world calculations. Syntax probably not correct and not checked.
-- The maths itself I have tested and found to be correct.
---- World from level:
------ if episodeNum <= 60 then worldNum = math.floor(episodeNum + 5 / 6)
------ else worldNum = math.floor(episodeNum + 2 / 3) - 10
---- First level from world:
------ if worldNum <= 10 then episodeNum = (worldNum - 1) * 6 + 1
------ else episodeNum = (worldNum - 11) * 3 + 61
end
 
local function _formatTitle ( t_ep, ncols ) 
-- accepts table with world info
-- fetches title info for specified episode, outputs MW title row
end
 
local function _formatRow ( index )
-- indexes lua table
end
 
 
 
-- PUBLIC (API methods) -- working set for testing
 
function p.displayInfo( frame )
------- retrieves title and rows of every level in a single world
------- formatted as MW table
 
--------- frame params:
--------- 'world' (required) specifying the world number
--------- 'leveltype' (optional) specifying level type
end
 
return p