mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-02 21:52:48 +00:00
This commit ports the StonedMC from /tg/station, intended to replace the Process Scheduler from goon. Currently, they exist simultaneously, as it's very difficult to port our 22 processes to the SMC all at once. Instead, we can make them work together until everything is converted over at a later point, and then take the old PS out back and put a couple of rounds into it's deformed skull. Primary benefits of this new process controller include: Other people that can actually maintain it, unlike the PS, pre-world-init initialization for subsystems, ease of ports from /tg/station13, and potential performance improvement (to be seen).
39 lines
1.2 KiB
Plaintext
39 lines
1.2 KiB
Plaintext
//See controllers/globals.dm
|
|
#define GLOBAL_MANAGED(X, InitValue)\
|
|
/datum/controller/global_vars/proc/InitGlobal##X(){\
|
|
##X = ##InitValue;\
|
|
gvars_datum_init_order += #X;\
|
|
}
|
|
#define GLOBAL_UNMANAGED(X) /datum/controller/global_vars/proc/InitGlobal##X() { return; }
|
|
|
|
#ifndef TESTING
|
|
#define GLOBAL_PROTECT(X)\
|
|
/datum/controller/global_vars/InitGlobal##X(){\
|
|
..();\
|
|
gvars_datum_protected_varlist[#X] = TRUE;\
|
|
}
|
|
#else
|
|
#define GLOBAL_PROTECT(X)
|
|
#endif
|
|
|
|
#define GLOBAL_REAL_VAR(X) var/global/##X
|
|
#define GLOBAL_REAL(X, Typepath) var/global##Typepath/##X
|
|
|
|
#define GLOBAL_RAW(X) /datum/controller/global_vars/var/global##X
|
|
|
|
#define GLOBAL_VAR_INIT(X, InitValue) GLOBAL_RAW(/##X); GLOBAL_MANAGED(X, InitValue)
|
|
|
|
#define GLOBAL_VAR_CONST(X, InitValue) GLOBAL_RAW(/const/##X) = InitValue; GLOBAL_UNMANAGED(X)
|
|
|
|
#define GLOBAL_LIST_INIT(X, InitValue) GLOBAL_RAW(/list/##X); GLOBAL_MANAGED(X, InitValue)
|
|
|
|
#define GLOBAL_LIST_EMPTY(X) GLOBAL_LIST_INIT(X, list())
|
|
|
|
#define GLOBAL_DATUM_INIT(X, Typepath, InitValue) GLOBAL_RAW(Typepath/##X); GLOBAL_MANAGED(X, InitValue)
|
|
|
|
#define GLOBAL_VAR(X) GLOBAL_RAW(/##X); GLOBAL_UNMANAGED(X)
|
|
|
|
#define GLOBAL_LIST(X) GLOBAL_RAW(/list/##X); GLOBAL_UNMANAGED(X)
|
|
|
|
#define GLOBAL_DATUM(X, Typepath) GLOBAL_RAW(Typepath/##X); GLOBAL_UNMANAGED(X)
|