Files
Paradise/code/datums/components
Fridge Burns 2f711fb321 Screwdrivers can now be recycled in autolathes (#21629)
* screwdriver can be put into autolathe

* Redundant and misspelt  comment

* minutia

Co-authored-by: JimKil3 <47290811+JimKil3@users.noreply.github.com>

* add COMSIG_TOOL_ATTACK

* tools can be inserted on harm intent

* use signal to allow screwdriver to be inserted into the autolathe

* accidental spaces

* parenthesis for clarity

* snake_case 1

Co-authored-by: JimKil3 <47290811+JimKil3@users.noreply.github.com>

* snake_case 2

Co-authored-by: JimKil3 <47290811+JimKil3@users.noreply.github.com>

* dont direct istype check the screwdriver

* . defaults to null

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* add SIGNAL_HANDLER to the proc that handles a signal

---------

Co-authored-by: JimKil3 <47290811+JimKil3@users.noreply.github.com>
Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
2023-08-12 18:21:17 +01:00
..
2022-11-08 23:08:40 +00:00
2022-11-08 23:08:40 +00:00
2022-11-08 23:08:40 +00:00
2022-12-19 23:44:07 +00:00
2022-11-08 23:08:40 +00:00
2022-11-08 23:08:40 +00:00
2022-11-08 23:08:40 +00:00
2023-02-28 14:38:27 -06:00
2022-11-08 23:08:40 +00:00
2022-11-08 23:08:40 +00:00
2022-11-08 23:08:40 +00:00
2022-11-08 23:08:40 +00:00

Datum Component System (DCS)

Concept

Loosely adapted from /vg/. This is an entity component system for adding behaviours to datums when inheritance doesn't quite cut it. By using signals and events instead of direct inheritance, you can inject behaviours without hacky overloads. It requires a different method of thinking, but is not hard to use correctly. If a behaviour can have application across more than one thing. Make it generic, make it a component. Atom/mob/obj event? Give it a signal, and forward it's arguments with a SendSignal() call. Now every component that want's to can also know about this happening.

See this thread for an introduction to the system as a whole.

See/Define signals and their arguments in __DEFINES\dcs\signals.dm