big refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-20 19:43:20 +02:00
parent dedbe949c8
commit fa1c3d5f40
6 changed files with 123 additions and 175 deletions
+4 -3
View File
@@ -1,6 +1,6 @@
aux.module 'util'
local temp, getn = g.aux.temp, g.getn
local temp, recycle, getn = temp, recycle, g.getn
function public.copy(t)
local copy = {}
@@ -205,9 +205,10 @@ end
do
local mt = {__call = function(self, key) return self[key] end}
function public.hashset(...) -- TODO rename/remove?
function public.set(t)
local self = {}
for i=1,arg.n do self[arg[i]] = true end
for i=1,getn(t) do self[t[i]] = true end
recycle(t)
return setmetatable(self, mt)
end
end
+1 -1
View File
@@ -58,7 +58,7 @@ end
--function public.to_string(params) -- TODO
-- local gold, silver, copper = to_gsc(params.copper or 0 + )
-- local settings = hashset(unpack(arg))
-- local settings = set(unpack(arg))
--end
function public.to_string(money, pad, trim, decimal_points, color, no_color)