circuit_variable ![code/modules/wiremod/core/variable.dm 6](git.png)
A circuit variable that holds the name, the datatype and the colour of the variable (taken from the datatype).
Used in integrated circuits for setter and getter circuit components.
Vars | |
color | The colour that appears in the UI. The value is set to the datatype's matching colour |
---|---|
datatype | The datatype of the circuit variable. Used by the setter and getter circuit components |
datatype_handler | The datatype handler for the circuit variable. |
listeners | The components that are currently listening. Triggers them when the value is updated. |
name | The display name of the circuit variable |
value | The current value held by the variable. |
Procs | |
add_listener | Adds a listener to receive inputs when the variable has a value that is set. |
remove_listener | Removes a listener to receive inputs when the variable has a value that is set. Listener will usually clean themselves up |
set_value | Sets the value of the circuit component and triggers the appropriate listeners |
Var Details
color ![code/modules/wiremod/core/variable.dm 17](git.png)
The colour that appears in the UI. The value is set to the datatype's matching colour
datatype ![code/modules/wiremod/core/variable.dm 11](git.png)
The datatype of the circuit variable. Used by the setter and getter circuit components
datatype_handler ![code/modules/wiremod/core/variable.dm 14](git.png)
The datatype handler for the circuit variable.
listeners ![code/modules/wiremod/core/variable.dm 25](git.png)
The components that are currently listening. Triggers them when the value is updated.
name ![code/modules/wiremod/core/variable.dm 8](git.png)
The display name of the circuit variable
value ![code/modules/wiremod/core/variable.dm 20](git.png)
The current value held by the variable.
Proc Details
add_listener
Adds a listener to receive inputs when the variable has a value that is set.
remove_listener
Removes a listener to receive inputs when the variable has a value that is set. Listener will usually clean themselves up
set_value
Sets the value of the circuit component and triggers the appropriate listeners