Transformed the machinery processor into an StonedMC subsystem

* This is PHASE 1 of a multi-phase conversion.  In this first phase we implement the subsystem, but leave it processing the existing global list variables.  In the next phase we will switch to use datum variables in the subsystem.  The main reason for splitting into two phases is ease of code review; change the meaningful code without the hundreds of machines -> SSmachines.machinery substitutions.
* We did declare macros for adding/removing things to the processing lists, and convert everywhere to use the macros.
* Added var/is_processing to /datum to keep track of whether an instance is already in a processing list (prevents it being in the list twice!) and also debugging, making sure its not in two lists etc.
* NOTE: The global machines list is **no longer sorted** for performance reasons.  As far as I know, the only module that actually ever cared was cameras.   Our camera system already handles its own sorting in the cameranets anyway, so it should no longer be needed.
This commit is contained in:
Leshana
2017-12-29 15:31:59 -05:00
parent 66e9d9cfdf
commit a97a574278
16 changed files with 237 additions and 35 deletions
+1 -1
View File
@@ -151,7 +151,7 @@ proc/cardinalrange(var/center)
/obj/machinery/am_shielding/proc/setup_core()
processing = 1
machines.Add(src)
START_MACHINE_PROCESSING(src)
if(!control_unit) return
control_unit.linked_cores.Add(src)
control_unit.reported_core_efficiency += efficiency
+2 -2
View File
@@ -15,7 +15,7 @@
var/problem = 0 // If this is not 0 there is some sort of issue in the powernet. Monitors will display warnings.
/datum/powernet/New()
powernets += src
START_PROCESSING_POWERNET(src)
..()
/datum/powernet/Destroy()
@@ -25,7 +25,7 @@
for(var/obj/machinery/power/M in nodes)
nodes -= M
M.powernet = null
powernets -= src
STOP_PROCESSING_POWERNET(src)
return ..()
//Returns the amount of excess power (before refunding to SMESs) from last tick.