Changes

no edit summary
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)
         local args = Utils.getTemplateArgs(frame)
+
         return getEquipment(frame):buildable() and "true" or ""
        local name = args.explicit[1] or args.implicit.pagename or ""
+
    end,
        local equip = Equipment(name)
+
    improvable = function(frame)
         return equip:buildable() and "true" or ""
+
         return getEquipment(frame):improvable() and "true" or ""
 
     end,
 
     end,
 
}
 
}
cssedit, gkautomate
7,064

edits