Files
Bubberstation/code/modules/wiremod/components/math/not.dm
SkyratBot af8c0d2977 [MIRROR] Refactors how components are triggered and refactors how ports are ordered (#7951)
* Refactors how components are triggered and refactors how ports are ordered (#60934)

Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>

* Refactors how components are triggered and refactors how ports are ordered

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>
2021-09-03 14:02:48 +01:00

26 lines
635 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/populate_ports()
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)
result.set_output(!input_port.value)