Files
Bubberstation/code/modules/wiremod/components/math/not.dm
SkyratBot 170863cfd7 [MIRROR] Circuit component descriptions and module names are now visible to the naked eye. (#7290)
* Circuit component descriptions and module names are now visible to the naked eye. (#60545)

* Circuit component descriptions and module names are now visible to the naked eye.

Co-authored-by: Gurkenglas <gurkenglas@hotmail.de>
2021-08-01 11:42:08 +01:00

30 lines
673 B
Plaintext

/**
* # Logic Component
*
* General logic unit with AND OR capabilities
*/
/obj/item/circuit_component/not
display_name = "Not"
desc = "A component that inverts its input."
/// The input port
var/datum/port/input/input_port
/// The result from the output
var/datum/port/output/result
circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL|CIRCUIT_FLAG_OUTPUT_SIGNAL
/obj/item/circuit_component/not/Initialize()
. = ..()
input_port = add_input_port("Input", PORT_TYPE_ANY)
result = add_output_port("Result", PORT_TYPE_NUMBER)
/obj/item/circuit_component/not/input_received(datum/port/input/port)
. = ..()
if(.)
return
result.set_output(!input_port.input_value)