mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-14 03:32:00 +00:00
* Integrated the component printer into the integrated circuit UI. You can now link integrated circuits to component printers (#62287) Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com> * Integrated the component printer into the integrated circuit UI. You can now link integrated circuits to component printers Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com> Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>
27 lines
674 B
Plaintext
27 lines
674 B
Plaintext
/**
|
|
* # Length Component
|
|
*
|
|
* Return the length of an input
|
|
*/
|
|
/obj/item/circuit_component/length
|
|
display_name = "Length"
|
|
desc = "A component that returns the length of its input."
|
|
category = "Math"
|
|
|
|
/// The input port
|
|
var/datum/port/input/input_port
|
|
|
|
/// The result from the output
|
|
var/datum/port/output/output
|
|
circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL|CIRCUIT_FLAG_OUTPUT_SIGNAL
|
|
|
|
/obj/item/circuit_component/length/populate_ports()
|
|
input_port = add_input_port("Input", PORT_TYPE_ANY)
|
|
|
|
output = add_output_port("Length", PORT_TYPE_NUMBER)
|
|
|
|
/obj/item/circuit_component/length/input_received(datum/port/input/port)
|
|
|
|
output.set_output(length(input_port.value))
|
|
|