Module:Param Parse: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
No edit summary
(+simplify parsing of knowledge by using parse.number)
Line 509: Line 509:


-- Knowledge
-- Knowledge
function parse.knowledge_func(points)
local points_valid = parse.number(points)
if not points_valid then
return nil
end
return '[[File:Knowledge_icon.png|link=Knowledge|width=18x18]] '..points_valid
end

function parse.knowledge_smw(points)
local points_valid = parse.number(points)
if not points_valid then
return nil
end
return 'knowledge,'..points_valid
end

parse.knowledge = {
parse.knowledge = {
name = 'knowledge',
name = 'knowledge',
func = parse.number,
func = {name = parse.knowledge_func, params = {Infobox.raw_param('knowledge')}},
smw_property = 'Knowledge',
smw_property = 'Knowledge'
smw_func = {name = parse.knowledge_smw, params = {Infobox.raw_param('knowledge')}},
}
}