Module:GameRoles

From TwogPedia
Revision as of 21:08, 30 September 2023 by Couchor (talk | contribs) (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")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

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