Module:GameRoles: Difference between revisions

From TwogPedia
(Created page with "local gameRoles = { dota = { ['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")
 
mNo edit summary
 
Line 1: Line 1:
local gameRoles = {
local gameRoles = {
     dota = {
     Dota2 = {
         ['1'] = 'Safe Lane',
         ['1'] = 'Safe Lane',
         ['2'] = 'Mid Lane',
         ['2'] = 'Mid Lane',

Latest revision as of 21:10, 30 September 2023

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