Files
Bubberstation/code/datums/components
SkyratBot c6497e5680 [MIRROR] Fixes runtime errors that occur when mindless mobs examine heirlooms, + code improvements [MDB IGNORE] (#11459)
* Fixes runtime errors that occur when mindless mobs examine heirlooms, + code improvements (#64827)

Mindless mobs (such as observers without an initialized mind) examining family heirlooms would cause runtime errors due to the user.mind.has_antag_datum(...) line.

    Rearranges the examine proc to prevent runtimes from occurring due to mindless mobs examining heirlooms. Adds an observer check at the beginning, just for sanity sake, even though it doesn't matter functionally.
    Renamed the proc to on_examine for clarity
    Auto doc'd the proc + comments
    Handled a reference on Destroy

* Fixes runtime errors that occur when mindless mobs examine heirlooms, + code improvements

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2022-02-12 11:30:16 +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