• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Difference between revisions of "Module:EliteShips"

From Kancolle Wiki
Jump to navigation Jump to search
com>Ckwng
(parse highlight thresholds)
com>Ckwng
(Refactor)
Line 1: Line 1:
 
local EliteShips = {}
 
local EliteShips = {}
 
local EliteShipsKai = require('Module:EliteShipsKai')
 
local EliteShipsKai = require('Module:EliteShipsKai')
local Ship = require('Module:Ship')
 
 
local getArgs = require('Module:GetArgs')
 
local getArgs = require('Module:GetArgs')
  
 
function EliteShips.Table(frame)
 
function EliteShips.Table(frame)
 
local args = getArgs{frame = frame}
 
local args = getArgs{frame = frame}
local ships = {}
+
return EliteShipsKai:Table(args)
for index, ship_name in ipairs(args) do
 
local split = mw.ustring.find(ship_name, '/')
 
if split == nil then
 
ships[index] = Ship:create(ship_name)
 
else
 
ships[index] = Ship:create(mw.ustring.sub(ship_name, 1, split - 1),mw.ustring.sub(ship_name, split + 1, -1))
 
end
 
end
 
local ranges = {}
 
for _, column in ipairs(EliteShipsKai._columns) do
 
local outstanding = args[column .. EliteShipsKai._outstanding_suffix]
 
local good = args[column .. EliteShipsKai._good_suffix]
 
if outstanding and good then
 
local operator = args[column .. EliteShipsKai._operator_suffix] or ">"
 
ranges[column] = {}
 
ranges[column].operator = operator
 
ranges[column].outstanding = tonumber(outstanding)
 
ranges[column].good = tonumber(good)
 
end
 
end
 
return EliteShipsKai:Table(ships, ranges)
 
 
end
 
end
  
 
return EliteShips
 
return EliteShips

Revision as of 22:50, 12 February 2015

Documentation for this module may be created at Module:EliteShips/doc

local EliteShips = {}
local EliteShipsKai = require('Module:EliteShipsKai')
local getArgs = require('Module:GetArgs')

function EliteShips.Table(frame)
	local args = getArgs{frame = frame}
	return EliteShipsKai:Table(args)
end

return EliteShips