Difference between revisions of "Module:Symphogear"

From Symphogear Wiki
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
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")
assert(frame.season <= data.seasonCount and frame.season > 0,"Invalid season number.")
+
local season = tonumber(frame.args.season)
  +
assert(season <= data.seasonCount and season > 0,"Invalid season number.")
return data.seasonsLocal[frame.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")
assert(frame.season <= data.seasonCount and frame.season > 0,"Invalid season number.")
+
local season = tonumber(frame.args.season)
  +
assert(season <= data.seasonCount and season > 0,"Invalid season number.")
return data.seasonsJP[frame.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")
assert(frame.season <= data.seasonsWithEpisodes and frame.season > 0,"Invalid season number.")
+
local season = tonumber(frame.args.season)
assert(frame.episode <= data.episodeCounts[frame.season] and frame.episode > 0,"Invalid episode number.")
+
local episode = tonumber(frame.args.episode)
  +
assert(season <= data.seasonsWithEpisodes and season > 0,"Invalid season number.")
return data.episodesLocal[frame.season][frame.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")
assert(frame.season <= data.seasonsWithEpisodes and frame.season > 0,"Invalid season number.")
+
local season = tonumber(frame.args.season)
assert(frame.episode <= data.episodeCounts[frame.season] and frame.episode > 0,"Invalid episode number.")
+
local episode = tonumber(frame.args.episode)
  +
assert(season <= data.seasonsWithEpisodes and season > 0,"Invalid season number.")
return data.episodesJP[frame.season][frame.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.