perf scale 2, tuning
[QuestHelper.git] / filter_core.lua
bloba91875d9e9a034070eedd6f04dadd80185411b70
1 QuestHelper_File["filter_core.lua"] = "Development Version"
2 QuestHelper_Loadtime["filter_core.lua"] = GetTime()
4 function QH_MakeFilter(name, func, params)
5 QuestHelper: Assert(params.friendly_reason)
6 QuestHelper: Assert(params.friendly_name)
7 return {
8 Process = function(self, item, ...)
9 if self.exceptions[item] then return false end
10 return func(item, ...)
11 end,
12 name = name,
13 friendly_reason = params.friendly_reason,
14 friendly_name = params.friendly_name,
15 exceptions = setmetatable({}, {__mode="k"}),
16 AddException = function(self, except)
17 self.exceptions[except] = true
18 end,
19 Disable = function (self)
20 QuestHelper_Pref["filter_" .. self.friendly_name] = false -- hackery
21 end
23 end