- 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:EquipmentPage"
Jump to navigation
Jump to search
(Created page with "local Utils = require("Module:Utils") local Equipment = require('Module:Equipment') return { buildable = function(frame) local args = Utils.getTemplateArgs(frame)...") |
|||
Line 1: | Line 1: | ||
local Utils = require("Module:Utils") | local Utils = require("Module:Utils") | ||
local Equipment = require('Module:Equipment') | local Equipment = require('Module:Equipment') | ||
+ | |||
+ | function getEquipment(frame) | ||
+ | local args = Utils.getTemplateArgs(frame) | ||
+ | local name = args.explicit[1] or args.implicit.pagename or "" | ||
+ | return Equipment(name) | ||
+ | end | ||
return { | return { | ||
+ | info = function(frame) | ||
+ | return getEquipment(frame):info() | ||
+ | end, | ||
+ | wikipedia = function(frame) | ||
+ | return getEquipment(frame):wikipedia() | ||
+ | end, | ||
buildable = function(frame) | buildable = function(frame) | ||
− | + | return getEquipment(frame):buildable() and "true" or "" | |
− | + | end, | |
− | + | improvable = function(frame) | |
− | return | + | return getEquipment(frame):improvable() and "true" or "" |
end, | end, | ||
} | } |
Revision as of 15:18, 27 October 2017
Documentation for this module may be created at Module:EquipmentPage/doc
local Utils = require("Module:Utils")
local Equipment = require('Module:Equipment')
function getEquipment(frame)
local args = Utils.getTemplateArgs(frame)
local name = args.explicit[1] or args.implicit.pagename or ""
return Equipment(name)
end
return {
info = function(frame)
return getEquipment(frame):info()
end,
wikipedia = function(frame)
return getEquipment(frame):wikipedia()
end,
buildable = function(frame)
return getEquipment(frame):buildable() and "true" or ""
end,
improvable = function(frame)
return getEquipment(frame):improvable() and "true" or ""
end,
}