Standardize MC subsystem initialization boilerplate

* Based on https://github.com/tgstation/tgstation/pull/25386
* Create macro for defining new subsystem types.
* Create PreInit proc to handle setup that needs to be done before the map loads
* Rename garbage_controller subsystem to garbage so it matches its global SSgarbage variable name.
This commit is contained in:
Leshana
2017-06-07 19:45:01 -04:00
parent e48b548f2b
commit d6b68dabdb
3 changed files with 28 additions and 15 deletions

View File

@@ -27,8 +27,15 @@
var/datum/controller/subsystem/queue_next
var/datum/controller/subsystem/queue_prev
// Used to initialize the subsystem BEFORE the map has loaded
//Do not override
/datum/controller/subsystem/New()
return
// Used to initialize the subsystem BEFORE the map has loaded
// Called AFTER Recover if that is called
// Prefer to use Initialize if possible
/datum/controller/subsystem/proc/PreInit()
return
//This is used so the mc knows when the subsystem sleeps. do not override.
/datum/controller/subsystem/proc/ignite(resumed = 0)