From 0251baf692741c5cf3173ff9415c94dbbc3719f3 Mon Sep 17 00:00:00 2001
From: thetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com>
Date: Sat, 30 Sep 2017 20:47:00 +0100
Subject: new_flow_logic.lua: move logic functions inside pipeworks.flowlogic
 sub-table

---
 new_flow_logic.lua | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

(limited to 'new_flow_logic.lua')

diff --git a/new_flow_logic.lua b/new_flow_logic.lua
index 1b4abf4..a65ac23 100644
--- a/new_flow_logic.lua
+++ b/new_flow_logic.lua
@@ -3,6 +3,11 @@
 
 
 
+local flowlogic = {}
+pipeworks.flowlogic = flowlogic
+
+
+
 -- borrowed from above: might be useable to replace the above coords tables
 local make_coords_offsets = function(pos, include_base)
 	local coords = {
@@ -28,7 +33,7 @@ end
 -- and returns it so that the receptacle can update it's pressure values.
 -- this should ensure that water blocks aren't vanished from existance.
 -- will take care of zero or negative-valued limits.
-pipeworks.check_for_liquids_v2 = function(pos, limit)
+flowlogic.check_for_liquids_v2 = function(pos, limit)
 	if not limit then
 		limit = 6
 	end
@@ -50,7 +55,7 @@ end
 
 local label_pressure = "pipeworks.water_pressure"
 local label_haspressure = "pipeworks.is_pressure_node"
-pipeworks.balance_pressure = function(pos, node)
+flowlogic.balance_pressure = function(pos, node)
 	-- debuglog("balance_pressure() "..node.name.." at "..pos.x.." "..pos.y.." "..pos.z)
 	-- check the pressure of all nearby nodes, and average it out.
 	-- for the moment, only balance neighbour nodes if it already has a pressure value.
@@ -84,7 +89,7 @@ end
 
 
 
-pipeworks.run_pump_intake = function(pos, node)
+flowlogic.run_pump_intake = function(pos, node)
 	-- try to absorb nearby water nodes, but only up to limit.
 	-- NB: check_for_liquids_v2 handles zero or negative from the following subtraction
 
@@ -103,7 +108,7 @@ end
 
 
 
-pipeworks.run_spigot_output = function(pos, node)
+flowlogic.run_spigot_output = function(pos, node)
 	-- try to output a water source node if there's enough pressure and space below.
 	local meta = minetest.get_meta(pos)
 	local currentpressure = meta:get_float(label_pressure)
-- 
cgit v1.2.3