// Like this:
var obj/poop/poop = locate() // locates a /obj/poop in the world
// But for custom procs; instead of this:
var component/my_custom_player_controller
controller = entity.GetComponent(/component/my_custom_player_controller)
// We can do this:
var component/my_custom_player_controller/controller = entity.GetComponent()
// Example syntax:
entity/proc/GetComponent(ComponentType = vartype)
// from above, vartype == /component/my_custom_player_controller
return locate(ComponentType) in _all_components
Now, I know that since GetComponent() uses locate(), I could write a hacky macro that takes advantage of how private variables aren't a thing (_all_components is kind of meant to be private):
#define GET_COMPONENT(ENTITY) locate() in ENTITY._all_components
// ...
var component/camera/camera = GET_COMPONENT(entity)