mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-30 11:12:43 +00:00
Turned a ton of unmanaged globals into managed globals. Refactored some UT output. Removed some unused things, including vars. Added a test to ensure people don't keep adding new unmanaged vars.
24 lines
1.4 KiB
Plaintext
24 lines
1.4 KiB
Plaintext
/*
|
|
* Performance behaviors for avoiding calling procs unecessarily on the Singletons global.
|
|
*/
|
|
|
|
/// Get a singleton instance according to path P. Creates it if necessary. Null if abstract or not a singleton.
|
|
#define GET_SINGLETON(P)\
|
|
(ispath(P, /singleton) ? (GLOB.Singletons.resolved_instances[P] ? GLOB.Singletons.instances[P] : GLOB.Singletons.GetInstanceOf(P)) : GLOB.Singletons.GetInstance(P))
|
|
|
|
/// Get a (path = instance) map of valid singletons according to typesof(P).
|
|
#define GET_SINGLETON_TYPE_MAP(P)\
|
|
(ispath(P, /singleton) ? (GLOB.Singletons.resolved_type_maps[P] ? GLOB.Singletons.type_maps[P] : GLOB.Singletons.GetTypeMap(P)) : list())
|
|
|
|
/// Get a (path = instance) map of valid singletons according to subtypesof(P).
|
|
#define GET_SINGLETON_SUBTYPE_MAP(P)\
|
|
(ispath(P, /singleton) ? (GLOB.Singletons.resolved_subtype_maps[P] ? GLOB.Singletons.subtype_maps[P] : GLOB.Singletons.GetSubtypeMap(P)) : list())
|
|
|
|
/// Get a list of valid singletons according to typesof(path).
|
|
#define GET_SINGLETON_TYPE_LIST(P)\
|
|
(ispath(P, /singleton) ? (GLOB.Singletons.resolved_type_lists[P] ? GLOB.Singletons.type_lists[P] : GLOB.Singletons.GetTypeList(P)) : list())
|
|
|
|
/// Get a list of valid singletons according to subtypesof(path).
|
|
#define GET_SINGLETON_SUBTYPE_LIST(P)\
|
|
(ispath(P, /singleton) ? (GLOB.Singletons.resolved_subtype_lists[P] ? GLOB.Singletons.subtype_lists[P] : GLOB.Singletons.GetSubtypeListOf(P)) : GLOB.Singletons.GetSubtypeList(P))
|