From 6a2fa5a3e49ce3612e857b39a0c12ea8420e6795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Mart=C3=ADnez?= Date: Wed, 1 Mar 2017 00:57:58 -0300 Subject: Rename global table to `digilines`. This also adds a backwards compat alias so other mods shouldn't break. --- util.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'util.lua') diff --git a/util.lua b/util.lua index cec75be..bea91d3 100644 --- a/util.lua +++ b/util.lua @@ -1,13 +1,13 @@ -function digiline:addPosRule(p, r) +function digilines:addPosRule(p, r) return {x = p.x + r.x, y = p.y + r.y, z = p.z + r.z} end -function digiline:cmpPos(p1, p2) +function digilines:cmpPos(p1, p2) return (p1.x == p2.x and p1.y == p2.y and p1.z == p2.z) end --Rules rotation Functions: -function digiline:rotate_rules_right(rules) +function digilines:rotate_rules_right(rules) local nr={} for i, rule in ipairs(rules) do nr[i]={} @@ -18,7 +18,7 @@ function digiline:rotate_rules_right(rules) return nr end -function digiline:rotate_rules_left(rules) +function digilines:rotate_rules_left(rules) local nr={} for i, rule in ipairs(rules) do nr[i]={} @@ -29,7 +29,7 @@ function digiline:rotate_rules_left(rules) return nr end -function digiline:rotate_rules_down(rules) +function digilines:rotate_rules_down(rules) local nr={} for i, rule in ipairs(rules) do nr[i]={} @@ -40,7 +40,7 @@ function digiline:rotate_rules_down(rules) return nr end -function digiline:rotate_rules_up(rules) +function digilines:rotate_rules_up(rules) local nr={} for i, rule in ipairs(rules) do nr[i]={} @@ -51,13 +51,13 @@ function digiline:rotate_rules_up(rules) return nr end -function digiline:tablecopy(table) -- deep table copy +function digilines:tablecopy(table) -- deep table copy if type(table) ~= "table" then return table end -- no need to copy local newtable = {} for idx, item in pairs(table) do if type(item) == "table" then - newtable[idx] = digiline:tablecopy(item) + newtable[idx] = digilines:tablecopy(item) else newtable[idx] = item end -- cgit v1.2.3