summaryrefslogtreecommitdiff
path: root/util.lua
diff options
context:
space:
mode:
authorDiego Martínez <kaeza@users.noreply.github.com>2017-03-01 00:57:58 -0300
committerAuke Kok <sofar+github@foo-projects.org>2017-03-14 21:57:01 -0700
commit6a2fa5a3e49ce3612e857b39a0c12ea8420e6795 (patch)
treec04c946337ed51277802836af2e3fa80868bc483 /util.lua
parent54b1b3fe91f2e7e774f305d4b57bb4367aca1cd6 (diff)
Rename global table to `digilines`.
This also adds a backwards compat alias so other mods shouldn't break.
Diffstat (limited to 'util.lua')
-rw-r--r--util.lua16
1 files changed, 8 insertions, 8 deletions
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