Module:RewardJsonParser/doc

Converts a JSON dump from HertzDevil's repository of reward definition to an ObjectArg hash or list of hash accepted by Module:RewardText.

convert
Return a normalized reward object than can be used in.

Example
The following JSON: [ {    "kind": 0, "_type": "orb", "count": 1 }, {    "kind": 1, "_type": "hero", "len": 16, "id_tag": "PID_エレミヤ", "rarity": 3 } ] will return a table equivalent to: table#1 { table#2 { ["count"] = 1, ["kind"] = "Orb", }, table#3 { ["count"] = 1, ["hero"] = "Eremiya: Bishop of Woe", ["kind"] = "Hero", ["rarity"] = 3, }, }

convertToString
Return a string that can be used in RewardText.

Example
The following JSON: [ {    "kind": 0, "_type": "orb", "count": 1 }, {    "kind": 1, "_type": "hero", "len": 16, "id_tag": "PID_エレミヤ", "rarity": 3 } ] will return a string equivalent to: [{kind=Orb};{hero=Eremiya: Bishop of Woe;rarity=3}]

convertWikitext
Same as convertToString, but can be called from wikitext as follows (You must substitute the module. Do not invoke it without substitution.): convertWikitext

Example
The following code: after substitution will produce the following code: which will result in: