Component Port
![code/modules/wiremod/core/port.dm 6](git.png)
A port used by a component. Connects to other ports.
Vars | |
color | The port color. If unset, appears as blue. |
---|---|
connected_component | The component this port is attached to |
datatype | The port type. Ports can only connect to each other if the type matches |
datatype_handler | The default port type. Stores the original datatype of the port set on Initialize. |
name | Name of the port. Used when displaying the port. |
order | The weight of the port. Determines the |
value | The value that's currently in the port. It's of the above type. |
Procs | |
datatype_ui_data | Returns the data from the datatype |
disconnect_all | Disconnects a port from all other ports. |
null_value | Signal handler proc to null the input if an atom is deleted. An update is not sent because this was not set by anything. |
on_value_qdeleting | Do our part in setting all source references anywhere to null. |
set_datatype | Sets the datatype of the port. |
set_value | Sets the port's value to value. Casts to the port's datatype (e.g. number -> string), and assumes this can be done. |
Var Details
color
![code/modules/wiremod/core/port.dm 23](git.png)
The port color. If unset, appears as blue.
connected_component
![code/modules/wiremod/core/port.dm 8](git.png)
The component this port is attached to
datatype
![code/modules/wiremod/core/port.dm 14](git.png)
The port type. Ports can only connect to each other if the type matches
datatype_handler
![code/modules/wiremod/core/port.dm 20](git.png)
The default port type. Stores the original datatype of the port set on Initialize.
name
![code/modules/wiremod/core/port.dm 11](git.png)
Name of the port. Used when displaying the port.
order
![code/modules/wiremod/core/port.dm 26](git.png)
The weight of the port. Determines the
value
![code/modules/wiremod/core/port.dm 17](git.png)
The value that's currently in the port. It's of the above type.
Proc Details
datatype_ui_data
Returns the data from the datatype
disconnect_all
Disconnects a port from all other ports.
Called by /obj/item/circuit_component whenever it is disconnected from an integrated circuit
null_value
Signal handler proc to null the input if an atom is deleted. An update is not sent because this was not set by anything.
on_value_qdeleting
Do our part in setting all source references anywhere to null.
set_datatype
Sets the datatype of the port.
Arguments:
- new_type - The type this port is to be set to.
set_value
Sets the port's value to value. Casts to the port's datatype (e.g. number -> string), and assumes this can be done.