Module:Console Edition Version

local p = {}; local data = mw.loadData('Module:Console Edition Version/Versions');

function getVersion(frame) local parent = frame:getParent local version = parent.args.version local platfrom = getPlatform(version) {v = data[platform][version], platform = platform} end

function getPlatform(version) if(version:find("^CU") ~= nil) then return "Xbox_One" end if(version:find("^TU") ~= nil) then return "Xbox_360" end if(version:find("^1\.0\.") ~= nil) then return "Nintendo_Switch" end if(version:find("^PATCH") ~= nil) then return "WiiU" end end

function p.convert(frame) local parent = frame:getParent local platform = parent.args.platform return getVersion(frame).v[platform] end