跳转到内容

模組:VG NFC category handle

被永久保护的模块
维基百科,自由的百科全书

这是本页的一个历史版本,由Where was I last night?留言 | 贡献2017年1月20日 (五) 04:09编辑。这可能和当前版本存在着巨大的差异。

require('Module:No globals')

local platformAlias = {
	-- Nintendo
	['红白机'] = {'紅白机', '紅白機', 'FC', 'Famicom', 'NES', 'Nintendo Entertainment System'},
	['超级任天堂'] = {'超级任天堂',  '超級任天堂', '超任', 'SFC', 'Super Famicom', 'SNES'},
	['任天堂64'] = {'任天堂64', 'N64'},
	['GameCube'] = {'GameCube', '任天堂GameCube', 'NGC'},
	['Wii'] = {'Wii'},
	['Wii U'] = {'Wii U', 'WiiU'},
	['任天堂Switch'] = {'任天堂Switch', 'Nintendo Switch', 'NS'},
	['Game Boy'] = {'Game ?Boy', 'GB'},
	['Game Boy Color'] = {'Game Boy Color', 'GBC'},
	['Game Boy Advance'] = {'Game Boy Advance', 'GBA'},
	['任天堂DS'] = {'任天堂DS', 'Nintendo DS', 'NDS'},
	['任天堂3DS'] = {'任天堂3DS', 'Nintendo 3DS', 'N3DS', '3DS'},
	
	-- Sony
	['PlayStation (游戏机)'] = {'PlayStation %(游戏机%)', 'PlayStation %(遊戲機%)', 'PlayStation', 'PS1'},
	['PlayStation 2'] = {'PlayStation 2', 'PS2'},
	['PlayStation 3'] = {'PlayStation 3', 'PS3'},
	['PlayStation 4'] = {'PlayStation 4', 'PS4'},
	['PlayStation Portable'] = {'PlayStation Portable', 'PSP'},
	['PlayStation Vita'] = {'PlayStation Vita', 'PSV', 'PSVita'},
	
	-- Microsoft
	['Xbox (游戏机)'] = {'Xbox %(游戏机%)', 'Xbox %(遊戲機%)', 'Xbox'},
	['Xbox 360'] = {'Xbox ?360', 'X360'},
	['Xbox One'] = {'Xbox? One', 'XOne'},
	
	-- Sega
	['世嘉Master System'] = {'世嘉Master System', 'Sega Master System', 'Master System', 'SMS'},
	['Mega Drive'] = {'Mega ?Drive', 'MD', 'Sega Genesis'},
	['世嘉土星'] = {'世嘉土星', 'Sega Saturn', 'SS'},
	['Dreamcast'] = {'Dreamcast'},
	
	-- Computer
	['Windows'] = {'Windows', 'Microsoft Windows'},
	['MacOS'] = {'macOS', 'Mac OS X', 'OS X'},
	
}


local getArgs = require('Module:Arguments').getArgs
local p = {}

function p.main(frame)
	local args = getArgs(frame)
	return p._main(args)
end

function p._main(args)
	-- Main module code goes here.
	for categoryName, aliases in pairs(platformAlias) do
		for _, k in ipairs(aliases) do
			if string.find(args[1], '^' .. k .. '$') then
				return categoryName
			end
		end
	end

	return args[1]

end

return p