Module:ShipClass

Revision as of 03:36, 13 February 2015 by com>Ckwng (Entry point for ship classes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

local ShipClass = {}
local ship_classes = {}

local ShipClassData = require('Module:ShipClassData')

function ShipClass:create(name)
	if model == nil then
		model = ""
	end
	local ship_class = ship_classes[name]
	if ship_class then
		return ship_class
	else
		local ship_class_table = require(mw.ustring.format('Module:%s', name))
		ship_class = ShipClassData(ship_class_table)
		ship_classes[name] = ship_class
		return ship_class
	end
end

ShipClass.__call = ShipClass.create
setmetatable(ShipClass, ShipClass)

return ShipClass