mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-13 03:02:38 +00:00
* Adds basic list manipulation and fixes some performance issues with lists in integrated circuits (#64541) Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com> * Adds basic list manipulation and fixes some performance issues with lists in integrated circuits Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com> Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>
24 lines
644 B
Plaintext
24 lines
644 B
Plaintext
/**
|
|
* # Getter Component
|
|
*
|
|
* Gets the current value from a variable.
|
|
*/
|
|
/obj/item/circuit_component/variable/getter
|
|
display_name = "Variable Getter"
|
|
desc = "A component that gets a variable globally on the circuit."
|
|
|
|
/// The value of the variable
|
|
var/datum/port/output/value
|
|
should_listen = TRUE
|
|
|
|
circuit_size = 0
|
|
|
|
/obj/item/circuit_component/variable/getter/populate_ports()
|
|
value = add_output_port("Value", PORT_TYPE_ANY)
|
|
|
|
/obj/item/circuit_component/variable/getter/pre_input_received(datum/port/input/port)
|
|
. = ..()
|
|
if(current_variable)
|
|
value.set_datatype(current_variable.datatype)
|
|
value.set_value(current_variable.value)
|