Модуль:Tools/today/getter: различия между версиями

(Новая страница: «local p = {} local events = require('Module:Tools/today/event') local sieges = require('Module:Tools/today/siege') local drafts = require('Module:Tools/today/dragondraft') function p.event_name(event) return events[events[event].name] end function p.event_icon(event) return events[events[event].icon] end function p.event_hero(event) return events[events[event].hero] end function p.event_heroes(event) local tbl = {} for _, v in ipairs(eve...»)
 
Нет описания правки
 
(не показано 6 промежуточных версий этого же участника)
Строка 3: Строка 3:
local sieges = require('Module:Tools/today/siege')
local sieges = require('Module:Tools/today/siege')
local drafts = require('Module:Tools/today/dragondraft')
local drafts = require('Module:Tools/today/dragondraft')
local labyrinths = require('Module:Tools/today/labyrinth')


function p.event_name(event)
function p.event_name(event)
     return events[events[event].name]
     return events[event].name
end
end


function p.event_icon(event)
function p.event_icon(event)
     return events[events[event].icon]
     return events[event].icon
end
end


function p.event_hero(event)
function p.event_hero(event)
     return events[events[event].hero]
     return events[event].hero
end
end


Строка 25: Строка 26:


function p.siege_name(siege)
function p.siege_name(siege)
     return sieges[sieges[siege].name]
     return sieges[siege].name
end
end


function p.siege_icon(siege)
function p.siege_icon(siege)
     return sieges[sieges[siege].icon]
     return sieges[siege].icon
end
end


function p.siege_hero(siege)
function p.siege_hero(siege)
     local tbl = {}
     return sieges[siege].hero
for _, v in ipairs(sieges[siege].heroes) do
table.insert(tbl, v)
end
return tbl
end
end


Строка 49: Строка 46:


function p.dragondraft_name(dragondraft)
function p.dragondraft_name(dragondraft)
     return drafts[drafts[dragondraft].name]
     return drafts[dragondraft].name
end
 
function p.dragondraft_link(dragondraft)
    return drafts[dragondraft].link
end
end


function p.dragondraft_icon(dragondraft)
function p.dragondraft_icon(dragondraft)
     return drafts[drafts[dragondraft].icon]
     return drafts[dragondraft].icon
end
end


function p.dragondraft_hero(dragondraft)
function p.dragondraft_hero(dragondraft)
     local tbl = {}
     return drafts[dragondraft].hero
for _, v in ipairs(drafts[dragondraft].heroes) do
table.insert(tbl, v)
end
return tbl
end
end


Строка 70: Строка 67:
end
end
return tbl
return tbl
end
function p.labyrinth_name(labyrinth)
    return labyrinths[labyrinth].name
end
function p.labyrinth_icon(labyrinth)
    return labyrinths[labyrinth].icon
end
function p.labyrinth_hero(labyrinth)
    return labyrinths[labyrinth].hero
end
function p.labyrinth_hero_small(labyrinth)
    return labyrinths[labyrinth].hero_small
end
end


return p
return p

Текущая версия от 04:03, 17 марта 2024


local p = {}
local events = require('Module:Tools/today/event')
local sieges = require('Module:Tools/today/siege')
local drafts = require('Module:Tools/today/dragondraft')
local labyrinths = require('Module:Tools/today/labyrinth')

function p.event_name(event)
    return events[event].name
end

function p.event_icon(event)
    return events[event].icon
end

function p.event_hero(event)
    return events[event].hero
end

function p.event_heroes(event)
    local tbl = {}
	for _, v in ipairs(events[event].other_heroes) do
		table.insert(tbl, v)
	end
	return tbl
end

function p.siege_name(siege)
    return sieges[siege].name
end

function p.siege_icon(siege)
    return sieges[siege].icon
end

function p.siege_hero(siege)
    return sieges[siege].hero
end

function p.siege_heroes(siege)
    local tbl = {}
	for _, v in ipairs(sieges[siege].other_heroes) do
		table.insert(tbl, v)
	end
	return tbl
end

function p.dragondraft_name(dragondraft)
    return drafts[dragondraft].name
end

function p.dragondraft_link(dragondraft)
    return drafts[dragondraft].link
end

function p.dragondraft_icon(dragondraft)
    return drafts[dragondraft].icon
end

function p.dragondraft_hero(dragondraft)
    return drafts[dragondraft].hero
end

function p.dragondraft_heroes(dragondraft)
    local tbl = {}
	for _, v in ipairs(drafts[dragondraft].other_heroes) do
		table.insert(tbl, v)
	end
	return tbl
end

function p.labyrinth_name(labyrinth)
    return labyrinths[labyrinth].name
end

function p.labyrinth_icon(labyrinth)
    return labyrinths[labyrinth].icon
end

function p.labyrinth_hero(labyrinth)
    return labyrinths[labyrinth].hero
end

function p.labyrinth_hero_small(labyrinth)
    return labyrinths[labyrinth].hero_small
end

return p