Difference between revisions of "Module:Symphogear"

From Symphogear Wiki
Jump to: navigation, search
Line 5: Line 5:
 
function symphogear.season (frame)
 
function symphogear.season (frame)
 
data = mw.loadData("Module:Symphogear/data")
 
data = mw.loadData("Module:Symphogear/data")
assert(frame.season <= data.seasonCount and frame.season > 0,"Invalid season number.")
+
assert(frame.args.season <= data.seasonCount and frame.args.season > 0,"Invalid season number.")
return data.seasonsLocal[frame.season]
+
return data.seasonsLocal[frame.args.season]
 
end
 
end
   
 
function symphogear.seasonJP (frame)
 
function symphogear.seasonJP (frame)
 
data = mw.loadData("Module:Symphogear/data")
 
data = mw.loadData("Module:Symphogear/data")
assert(frame.season <= data.seasonCount and frame.season > 0,"Invalid season number.")
+
assert(frame.args.season <= data.seasonCount and frame.args.season > 0,"Invalid season number.")
return data.seasonsJP[frame.season]
+
return data.seasonsJP[frame.args.season]
 
end
 
end
   
 
function symphogear.episode (frame)
 
function symphogear.episode (frame)
 
data = mw.loadData("Module:Symphogear/data")
 
data = mw.loadData("Module:Symphogear/data")
assert(frame.season <= data.seasonsWithEpisodes and frame.season > 0,"Invalid season number.")
+
assert(frame.args.season <= data.seasonsWithEpisodes and frame.args.season > 0,"Invalid season number.")
assert(frame.episode <= data.episodeCounts[frame.season] and frame.episode > 0,"Invalid episode number.")
+
assert(frame.args.episode <= data.episodeCounts[frame.args.season] and frame.args.episode > 0,"Invalid episode number.")
return data.episodesLocal[frame.season][frame.episode]
+
return data.episodesLocal[frame.args.season][frame.args.episode]
 
end
 
end
   
 
function symphogear.episodeJP (frame)
 
function symphogear.episodeJP (frame)
 
data = mw.loadData("Module:Symphogear/data")
 
data = mw.loadData("Module:Symphogear/data")
assert(frame.season <= data.seasonsWithEpisodes and frame.season > 0,"Invalid season number.")
+
assert(frame.args.season <= data.seasonsWithEpisodes and frame.args.season > 0,"Invalid season number.")
assert(frame.episode <= data.episodeCounts[frame.season] and frame.episode > 0,"Invalid episode number.")
+
assert(frame.args.episode <= data.episodeCounts[frame.args.season] and frame.args.episode > 0,"Invalid episode number.")
return data.episodesJP[frame.season][frame.episode]
+
return data.episodesJP[frame.args.season][frame.args.episode]
 
end
 
end
   

Revision as of 10:40, 13 June 2018

Gives access to standardised names for seasons and episodes, as well as easy access to the Japanese names.