Module:Prayer: Difference between revisions

104 bytes removed ,  10 October 2023
Undo revision 64398 by Vazkii (talk)
(Overload p.getPrayerTable to allow for passing in a predicate)
(Undo revision 64398 by Vazkii (talk))
Tag: Undo
Line 131: Line 131:


function p.getPrayerTable(frame)
function p.getPrayerTable(frame)
return p.getPrayerTable(frame, function(prayer) return true end)
end
function p.getPrayerTable(frame, prayerPredicate)
local result = '{| class="wikitable sortable stickyHeader"'
local result = '{| class="wikitable sortable stickyHeader"'
result = result..'\r\n|-class=headerRow-0'
result = result..'\r\n|-class=headerRow-0'
Line 140: Line 136:
result = result..'!!Effects!!Point Cost'
result = result..'!!Effects!!Point Cost'


local prayerList = p.getPrayers(prayerPredicate)
local prayerList = p.getPrayers(function(prayer) return true end)
table.sort(prayerList, function(a, b)
table.sort(prayerList, function(a, b)
if a.level == b.level then
if a.level == b.level then
48

edits