diff options
author | Diego MartÃnez <kaeza@users.noreply.github.com> | 2017-03-01 00:57:58 -0300 |
---|---|---|
committer | Auke Kok <sofar+github@foo-projects.org> | 2017-03-14 21:57:01 -0700 |
commit | 6a2fa5a3e49ce3612e857b39a0c12ea8420e6795 (patch) | |
tree | c04c946337ed51277802836af2e3fa80868bc483 /internal.lua | |
parent | 54b1b3fe91f2e7e774f305d4b57bb4367aca1cd6 (diff) |
Rename global table to `digilines`.
This also adds a backwards compat alias so other mods
shouldn't break.
Diffstat (limited to 'internal.lua')
-rw-r--r-- | internal.lua | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/internal.lua b/internal.lua index 45cd5d7..e189130 100644 --- a/internal.lua +++ b/internal.lua @@ -1,15 +1,15 @@ -function digiline:getspec(node) +function digilines:getspec(node) if not minetest.registered_nodes[node.name] then return false end return minetest.registered_nodes[node.name].digiline end -function digiline:importrules(spec, node) +function digilines:importrules(spec, node) if type(spec) == 'function' then return spec(node) elseif spec then return spec else - return digiline.rules.default + return digilines.rules.default end end @@ -19,10 +19,10 @@ function digiline:getAnyInputRules(pos) if not spec then return end if spec.wire then - return digiline:importrules(spec.wire.rules, node) + return digilines:importrules(spec.wire.rules, node) end if spec.effector then - return digiline:importrules(spec.effector.rules, node) + return digilines:importrules(spec.effector.rules, node) end end @@ -32,24 +32,24 @@ function digiline:getAnyOutputRules(pos) if not spec then return end if spec.wire then - return digiline:importrules(spec.wire.rules, node) + return digilines:importrules(spec.wire.rules, node) end if spec.receptor then - return digiline:importrules(spec.receptor.rules, node) + return digilines:importrules(spec.receptor.rules, node) end end -function digiline:rules_link(output, input) - local outputrules = digiline:getAnyOutputRules(output) - local inputrules = digiline:getAnyInputRules (input) +function digilines:rules_link(output, input) + local outputrules = digilines:getAnyOutputRules(output) + local inputrules = digilines:getAnyInputRules (input) if not outputrules or not inputrules then return false end for _, orule in ipairs(outputrules) do - if digiline:cmpPos(digiline:addPosRule(output, orule), input) then + if digilines:cmpPos(digilines:addPosRule(output, orule), input) then for _, irule in ipairs(inputrules) do - if digiline:cmpPos(digiline:addPosRule(input, irule), output) then + if digilines:cmpPos(digilines:addPosRule(input, irule), output) then return true end end @@ -58,9 +58,9 @@ function digiline:rules_link(output, input) return false end -function digiline:rules_link_anydir(output, input) - return digiline:rules_link(output, input) - or digiline:rules_link(input, output) +function digilines:rules_link_anydir(output, input) + return digilines:rules_link(output, input) + or digilines:rules_link(input, output) end local function queue_new() |