refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-26 07:58:48 +02:00
parent 7cc21640ca
commit 98eaa48480
27 changed files with 86 additions and 73 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
aux 'completion' import 'filter_util'
aux 'completion' local filter_util = aux.filter_util
function public:complete_filter()
if IsControlKeyDown() then -- TODO problem is ctrl-v, maybe find a better solution
-8
View File
@@ -64,14 +64,6 @@ function public.index(t, ...) temp=arg
return t
end
function public.set(...) temp=arg
local t = t
for i=1,arg.n do
t[arg[i]] = true
end
return t
end
public.huge = 1.8*10^308
function public.modified.get() return IsShiftKeyDown() or IsControlKeyDown() or IsAltKeyDown() end
+4 -8
View File
@@ -1,8 +1,4 @@
aux 'filter_util' import 'info'
function LOAD()
import 'cache'
end
aux 'filter_util' local info, cache = aux.info, aux.cache
function default_filter(str)
return {
@@ -208,7 +204,7 @@ public.filters = {
function operator(str)
local operator = str == 'not' and -list('operator', 'not', 1)
for _, name in -temp-list('and', 'or') do
for name in -temp-set('and', 'or') do
for arity in present(select(3, strfind(str, '^'..name..'(%d*)$'))) do
arity = tonumber(arity)
operator = not (arity and arity < 2) and -list('operator', name, arity)
@@ -229,7 +225,7 @@ do
end
for number in present(tonumber(select(3, strfind(str, '^(%d+)$')))) do
if number >= 1 and number <= 60 then
for _, filter in -temp-list('min_level', 'max_level') do
for filter in -temp-set('min_level', 'max_level') do
if not self[filter] then
self[filter] = {str, number}
return true
@@ -517,7 +513,7 @@ function blizzard_query(components)
query.slot = slot_index
query.quality = item_info.quality
else
for _, key in -temp-list('min_level', 'max_level', 'class', 'subclass', 'slot', 'usable', 'quality') do
for key in -temp-set('min_level', 'max_level', 'class', 'subclass', 'slot', 'usable', 'quality') do
query[key] = index(filters[key], 2)
end
end
+1 -5
View File
@@ -1,8 +1,4 @@
aux 'scan_util' import 'info'
function LOAD()
import 'filter_util' 'scan'
end
aux 'scan_util' local info , filter_util, scan = aux.info, aux.filter_util, aux.scan
function public.find(auction_record, status_bar, on_abort, on_failure, on_success)