Module:GameRoles

From TwogPedia
Revision as of 21:10, 30 September 2023 by Couchor (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:GameRoles/doc

local gameRoles = {
    Dota2 = {
        ['1'] = 'Safe Lane',
        ['2'] = 'Mid Lane',
        ['3'] = 'Off Lane',
        ['4'] = 'Support',
        ['5'] = 'Hard Support',
    }
}

local p = {}

function p.convertRole(game, role)
    local gameData = gameRoles[game]
    if gameData then
        local roleData = gameData[role]
        if roleData then return roleData end
    end
    return role
end

return p