mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-28 18:11:16 +00:00
## About The Pull Request While working on another PR, I noticed that there wasn't any real distinction between subsystems that function as a network for various logical components/systems in the code, and subsystems that are meant to represent what is actually an in-game network. As such, I moved what seemed to be clear representations of the functions of in-game networks under their own subfolder. This should have no effects otherwise. ## Why It's Good For The Game Per an .md I added in the folder, it helps to clearly demarcate what are backend programmatic networked systems, and what are meant to actually be a network in the game itself; the radio jammer disrupts your suit sensors and headset, not your signal relationships with DCS, and I believe having that distinction be clear at a glance of the file structure is valuable. ## Changelog 🆑 Bisar code: Subsystems that are meant to represent a network in-game have been moved into their own category inside the codebase. /🆑
43 lines
1.5 KiB
Plaintext
43 lines
1.5 KiB
Plaintext
/**
|
|
* This subsystem is to handle creating and storing
|
|
* composite templates that are used to create composite datatypes
|
|
* for integrated circuits
|
|
*
|
|
* See: https://en.wikipedia.org/wiki/Composite_data_type
|
|
**/
|
|
SUBSYSTEM_DEF(wiremod_composite)
|
|
name = "Wiremod Composite Templates"
|
|
flags = SS_NO_FIRE
|
|
/// The templates created and stored
|
|
var/list/templates = list()
|
|
|
|
/datum/controller/subsystem/wiremod_composite/PreInit()
|
|
. = ..()
|
|
// This needs to execute before global variables have initialized.
|
|
for(var/datum/circuit_composite_template/type as anything in subtypesof(/datum/circuit_composite_template))
|
|
if(!initial(type.datatype))
|
|
continue
|
|
templates[initial(type.datatype)] = new type()
|
|
|
|
/datum/controller/subsystem/wiremod_composite/Initialize()
|
|
for(var/type in templates)
|
|
var/datum/circuit_composite_template/template = templates[type]
|
|
template.Initialize()
|
|
return SS_INIT_SUCCESS
|
|
|
|
/**
|
|
* Used to produce a composite datatype using another datatype, or
|
|
* to get an already existing composite datatype.
|
|
*/
|
|
/datum/controller/subsystem/wiremod_composite/proc/composite_datatype(datatype, ...)
|
|
var/datum/circuit_composite_template/type = templates[datatype]
|
|
if(!type)
|
|
return
|
|
return type.generate_composite_type(args.Copy(2))
|
|
|
|
/datum/controller/subsystem/wiremod_composite/proc/get_composite_type(base_type, datatype)
|
|
var/datum/circuit_composite_template/template = templates[base_type]
|
|
if(!template)
|
|
return
|
|
return template.generated_types[datatype]
|