Difference between revisions of "Module:Symphogear"
Fishsicles (talk | contribs) |
Fishsicles (talk | contribs) |
||
Line 4: | Line 4: | ||
function symphogear.season (frame) |
function symphogear.season (frame) |
||
− | data = mw.loadData("Module:Symphogear/data") |
+ | local data = mw.loadData("Module:Symphogear/data") |
− | + | local season = tonumber(frame.args.season) |
|
+ | assert(season <= data.seasonCount and season > 0,"Invalid season number.") |
||
− | return data.seasonsLocal[frame.args.season] |
||
+ | return data.seasonsLocal[season] |
||
end |
end |
||
function symphogear.seasonJP (frame) |
function symphogear.seasonJP (frame) |
||
− | data = mw.loadData("Module:Symphogear/data") |
+ | local data = mw.loadData("Module:Symphogear/data") |
− | + | local season = tonumber(frame.args.season) |
|
+ | assert(season <= data.seasonCount and season > 0,"Invalid season number.") |
||
− | return data.seasonsJP[frame.args.season] |
||
+ | return data.seasonsJP[season] |
||
end |
end |
||
function symphogear.episode (frame) |
function symphogear.episode (frame) |
||
− | data = mw.loadData("Module:Symphogear/data") |
+ | local data = mw.loadData("Module:Symphogear/data") |
− | + | local season = tonumber(frame.args.season) |
|
− | + | local episode = tonumber(frame.args.episode) |
|
+ | assert(season <= data.seasonsWithEpisodes and season > 0,"Invalid season number.") |
||
− | return data.episodesLocal[frame.args.season][frame.args.episode] |
||
+ | assert(episode <= data.episodeCounts[season] and episode > 0,"Invalid episode number.") |
||
+ | return data.episodesLocal[season][episode] |
||
end |
end |
||
function symphogear.episodeJP (frame) |
function symphogear.episodeJP (frame) |
||
− | data = mw.loadData("Module:Symphogear/data") |
+ | local data = mw.loadData("Module:Symphogear/data") |
− | + | local season = tonumber(frame.args.season) |
|
− | + | local episode = tonumber(frame.args.episode) |
|
+ | assert(season <= data.seasonsWithEpisodes and season > 0,"Invalid season number.") |
||
− | return data.episodesJP[frame.args.season][frame.args.episode] |
||
+ | assert(episode <= data.episodeCounts[season] and episode > 0,"Invalid episode number.") |
||
+ | return data.episodesJP[season][episode] |
||
end |
end |
||
Latest revision as of 10:44, 13 June 2018
Gives access to standardised names for seasons and episodes, as well as easy access to the Japanese names.