mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 21:48:39 +01:00
[MIRROR] Refactors port types completely and adds the option type. Refactors options to use this new type (#7386)
* Refactors port types completely and adds the option type. Refactors options to use this new type (#60571) Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com> * Refactors port types completely and adds the option type. Refactors options to use this new type Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com> Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>
This commit is contained in:
co-authored by
Watermelon914
Watermelon914
parent
742f11f0d8
commit
3ab1e7ebe2
@@ -19,11 +19,13 @@
|
||||
/// The result from the output
|
||||
var/datum/port/output/result
|
||||
|
||||
var/list/datum/port/input/compare_ports = list()
|
||||
|
||||
/obj/item/circuit_component/compare/Initialize()
|
||||
. = ..()
|
||||
for(var/port_id in 1 to input_port_amount)
|
||||
var/letter = ascii2text(text2ascii("A") + (port_id-1))
|
||||
add_input_port(letter, PORT_TYPE_ANY)
|
||||
compare_ports += add_input_port(letter, PORT_TYPE_ANY)
|
||||
|
||||
load_custom_ports()
|
||||
compare = add_input_port("Compare", PORT_TYPE_SIGNAL)
|
||||
@@ -43,11 +45,7 @@
|
||||
if(.)
|
||||
return
|
||||
|
||||
var/list/ports = input_ports.Copy()
|
||||
if(input_port_amount)
|
||||
ports.Cut(input_port_amount+1)
|
||||
|
||||
var/logic_result = do_comparisons(ports)
|
||||
var/logic_result = do_comparisons(compare_ports)
|
||||
if(COMPONENT_TRIGGERED_BY(compare, port))
|
||||
if(logic_result)
|
||||
true.set_output(COMPONENT_SIGNAL)
|
||||
|
||||
Reference in New Issue
Block a user