Модуль:Tools/today/getter

Версия от 08:12, 12 ноября 2023; JustPlayer (обсуждение | вклад) (Новая страница: «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...»)
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

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(events[event].other_heroes) do
		table.insert(tbl, v)
	end
	return tbl
end

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

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

function p.siege_hero(siege)
    local tbl = {}
	for _, v in ipairs(sieges[siege].heroes) do
		table.insert(tbl, v)
	end
	return tbl
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[drafts[dragondraft].name]
end

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

function p.dragondraft_hero(dragondraft)
    local tbl = {}
	for _, v in ipairs(drafts[dragondraft].heroes) do
		table.insert(tbl, v)
	end
	return tbl
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

return p