Module:OOO/Data
Appearance
Documentation for this module may be created at Module:OOO/Data/doc
local M = {}
local buckets = {
Buildings = mw.loadData('Module:OOO/Data/Buildings'),
Vehicles = mw.loadData('Module:OOO/Data/Vehicles'),
}
local function norm(id) return tostring(tonumber(id) or id) end
function M.get(domain, id)
local t = domain and buckets[domain]
if not t or not id then return nil end
return t[norm(id)]
end
-- Optional convenience: "Domain:ID" (e.g., "Buildings:400113")
function M.lookup(key)
local domain, id = tostring(key or ""):match("^([^:]+):(.+)$")
if domain and id then return M.get(domain, id) end
return nil
end
return M