Module:Param Parse: Difference between revisions

+simplify parsing of knowledge by using parse.number
No edit summary
(+simplify parsing of knowledge by using parse.number)
Line 509:
 
-- 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 = {
name = 'knowledge',
func = parse.number,
func = {name = parse.knowledge_func, params = {Infobox.raw_param('knowledge')}},
smw_property = 'Knowledge',
smw_func = {name = parse.knowledge_smw, params = {Infobox.raw_param('knowledge')}},
}
 
134

edits