Files
kiwistation/code/__DEFINES/components.dm
T
Jordan Brown 2c92735520 Port material containers to datum components (#29268)
* Ports /vg/'s component system

* Fix component signalling itself for addition

* Fix the list arrangement for removal

* Whoops

* Return the existing component if the created one was deleted

* These can't be ints

* ,

* returning TRUE from a callback will mark the event as handled

* Small refactor

* Add powered components

* R e f a c t o r

* More wip

* Fixes et al

* Pure pain

* When bae tells you she was tabs but she was actually spaces

* RReee

* Needs arglist

* Fax

* Fax

* More better

* You fail me yet again git commit

* Some kajiggering, but there we go

* No more 3rd param = variadic

* fix

* Sanity

* Whoops

* Minor thing

* Whoops

* fax

* Better describe the function, + add ..()s

* Fix

* Port to Initialize

* fuk in git
2017-08-30 15:11:34 +02:00

21 lines
1.3 KiB
Plaintext

//shorthand
#define GET_COMPONENT_FROM(varname, path, target) var##path/##varname = ##target.GetComponent(##path)
#define GET_COMPONENT(varname, path) GET_COMPONENT_FROM(varname, path, src)
// How multiple components of the exact same type are handled in the same datum
#define COMPONENT_DUPE_HIGHLANDER 0 //old component is deleted (default)
#define COMPONENT_DUPE_ALLOWED 1 //duplicates allowed
#define COMPONENT_DUPE_UNIQUE 2 //new component is deleted
// All signals. Format:
// When the signal is called: (signal arguments)
#define COMSIG_COMPONENT_ADDED "component_added" //when a component is added to a datum: (datum/component)
#define COMSIG_COMPONENT_REMOVING "component_removing" //before a component is removed from a datum because of RemoveComponent: (datum/component)
#define COMSIG_PARENT_QDELETED "parent_qdeleted" //before a datum's Destroy() is called: ()
#define COMSIG_PARENT_ATTACKBY "atom_attackby" //from the base of atom/attackby: (obj/item, mob/living, params)
#define COMSIG_PARENT_EXAMINE "atom_examine" //from the base of atom/examine: (mob)
#define COMSIG_ATOM_ENTERED "atom_entered" //from base of atom/Entered(): (atom/movable, atom)
#define COMSIG_MOVABLE_CROSSED "movable_crossed" //from base of atom/movable/Crossed(): (atom/movable)