Files
Bubberstation/code/datums/components
SkyratBot aef7cc4ab2 [MIRROR] Refactors slimelink and mansus link to be a component to cut down on hard-dels / code copy+paste [MDB IGNORE] (#11496)
* Refactors slimelink and mansus link to be a component to cut down on hard-dels / code copy+paste (#64836)

So this started out as a hard delete fix for the mansus link

Then I realized the mansus link was literally copy+pasted exactly the same code
And the reason why mansus link was hard-delling was because slime link used to hard-del and those were fixed but those fixes were never copied over

So in a fit of rage I refactored the slimelink to be a component, datum/component/mind_linker. Raw Prophets and Stargazers use it.

I'm not 100% certain on some of the methods used but it works? It works.

* Refactors slimelink and mansus link to be a component to cut down on hard-dels / code copy+paste

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2022-02-14 06:10:49 +00:00
..
2021-09-25 04:17:06 +01:00
2021-09-19 22:24:40 +01: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.

HackMD page for an introduction to the system as a whole.

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