Anonymous

Module:Shop: Difference between revisions

From Melvor Idle
Added p.getPurchases for use in the ModifierTables module I'm working on
(Remove special handling of Cape of Completion, as now exists within shop data)
(Added p.getPurchases for use in the ModifierTables module I'm working on)
Line 173: Line 173:


   return purchaseArray
   return purchaseArray
end
function p.getPurchases(checkFunc)
  local purchaseList = {}
  for category, purchaseArray in Shared.skpairs(ShopData.Shop) do
    for i, purchase in Shared.skpairs(purchaseArray) do
      if checkFunc(purchase) then
        table.insert(purchaseList, p.processPurchase(category, i - 1))
      end
    end
  end
  return purchaseList
end
end