Aller au contenu

Module:Distribution

De Heroes Wiki
local data = require("Module:Distribution/data")
local p = {}

-- Function 1: Get cast type
function p.getCastType(frame)
    local key = string.lower(frame.args[1] or "")
    local entry = data[key]

    if not entry then
        return "Crédits de fin dans"
    end

    local cast, _ = unpack(entry)

    return string.format("%s", cast)
end

-- Function 2: Get cast marking
function p.getCastMarking(frame)
    local key = string.lower(frame.args[1] or "")
    local entry = data[key]

    if not entry then
        return "Crédits de fin"
    end

    local _, marking = unpack(entry)

    return string.format("%s", marking)
end

return p