/tg/ Station 13 - Modules - TypesVar Details - Proc Details

Component Port

A base type port used by a component

Connects to other ports. This is an abstract type that should not be instanciated

Vars

colorThe port color. If unset, appears as blue.
connected_componentThe component this port is attached to
datatypeThe port type. Ports can only connect to each other if the type matches
default_datatypeThe default port type. Stores the original datatype of the port set on Initialize.
nameName of the port. Used when displaying the port.

Procs

convert_valueReturns the value to be set for the port
datatype_to_colorConverts the datatype into an appropriate colour
disconnectDisconnects a port from all other ports
set_datatypeSets the datatype of the port.

Var Details

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

default_datatype

The default port type. Stores the original datatype of the port set on Initialize.

name

Name of the port. Used when displaying the port.

Proc Details

convert_value

Returns the value to be set for the port

Used for implicit conversions between outputs and inputs (e.g. number -> string) and applying/removing signals on inputs

datatype_to_color

Converts the datatype into an appropriate colour

disconnect

Disconnects a port from all other ports

Called by /obj/item/circuit_component whenever it is disconnected from an integrated circuit

set_datatype

Sets the datatype of the port.

Arguments: