Files
Bubberstation/code/modules/wiremod/components/atom/gps.dm
SkyratBot 4179614ebb [MIRROR] Made admin circuits more abstract, they no longer end up in the contents of the shell. [MDB IGNORE] (#9318)
* Made admin circuits more abstract, they no longer end up in the contents of the shell. (#62630)

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

* Made admin circuits more abstract, they no longer end up in the contents of the shell.

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>
2021-11-08 22:26:45 -05:00

31 lines
800 B
Plaintext

/**
* # GPS Component
*
* Return the location of this
*/
/obj/item/circuit_component/gps
display_name = "Internal GPS"
desc = "A component that returns the xyz co-ordinates of itself."
category = "Entity"
/// The result from the output
var/datum/port/output/x_pos
var/datum/port/output/y_pos
var/datum/port/output/z_pos
circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL|CIRCUIT_FLAG_OUTPUT_SIGNAL
/obj/item/circuit_component/gps/populate_ports()
x_pos = add_output_port("X", PORT_TYPE_NUMBER)
y_pos = add_output_port("Y", PORT_TYPE_NUMBER)
z_pos = add_output_port("Z", PORT_TYPE_NUMBER)
/obj/item/circuit_component/gps/input_received(datum/port/input/port)
var/turf/location = get_location()
x_pos.set_output(location?.x)
y_pos.set_output(location?.y)
z_pos.set_output(location?.z)