diff options
author | thetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com> | 2017-09-30 23:42:26 +0100 |
---|---|---|
committer | thetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com> | 2017-09-30 23:42:26 +0100 |
commit | c3627551b091d27819c242da204ed1e9dd8f15f0 (patch) | |
tree | fb51d5e91b5a6357327266b00f466881b9be1f60 /flowable_node_registry.lua | |
parent | d69941a0ae763d6681ede2185ad88e25b11fead5 (diff) |
move all current new_flow_logic code to dedicated sub-directory
Diffstat (limited to 'flowable_node_registry.lua')
-rw-r--r-- | flowable_node_registry.lua | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/flowable_node_registry.lua b/flowable_node_registry.lua deleted file mode 100644 index def9649..0000000 --- a/flowable_node_registry.lua +++ /dev/null @@ -1,59 +0,0 @@ --- registration code for nodes under new flow logic --- written 2017 by thetaepsilon - -pipeworks.flowables = {} -pipeworks.flowables.list = {} -pipeworks.flowables.list.all = {} --- pipeworks.flowables.list.nodenames = {} - --- simple flowables - balance pressure in any direction -pipeworks.flowables.list.simple = {} -pipeworks.flowables.list.simple_nodenames = {} - --- simple intakes - try to absorb any adjacent water nodes -pipeworks.flowables.inputs = {} -pipeworks.flowables.inputs.list = {} -pipeworks.flowables.inputs.nodenames = {} - --- registration functions -pipeworks.flowables.register = {} -local register = pipeworks.flowables.register - --- some sanity checking for passed args, as this could potentially be made an external API eventually -local checkexists = function(nodename) - if type(nodename) ~= "string" then error("pipeworks.flowables nodename must be a string!") end - return pipeworks.flowables.list.all[nodename] -end - -local insertbase = function(nodename) - if checkexists(nodename) then error("pipeworks.flowables duplicate registration!") end - pipeworks.flowables.list.all[nodename] = true - -- table.insert(pipeworks.flowables.list.nodenames, nodename) -end - --- Register a node as a simple flowable. --- Simple flowable nodes have no considerations for direction of flow; --- A cluster of adjacent simple flowables will happily average out in any direction. --- This does *not* register the ABM, as that is done in register_flow_logic.lua; --- this is so that the new flow logic can remain optional during development. -register.simple = function(nodename) - insertbase(nodename) - pipeworks.flowables.list.simple[nodename] = true - table.insert(pipeworks.flowables.list.simple_nodenames, nodename) -end - -local checkbase = function(nodename) - if not checkexists(nodename) then error("pipeworks.flowables node doesn't exist as a flowable!") end -end - --- Register a node as a simple intake. --- See new_flow_logic for the details of this. --- Expects node to be registered as a flowable (is present in flowables.list.all), --- so that water can move out of it. --- maxpressure is the maximum pipeline pressure that this node can drive. --- possible WISHME here: technic-driven high-pressure pumps -register.intake_simple = function(nodename, maxpressure) - checkbase(nodename) - pipeworks.flowables.inputs.list[nodename] = { maxpressure=maxpressure } - table.insert(pipeworks.flowables.inputs.nodenames, nodename) -end |