Files
Bubberstation/code/datums/components
Mothblocks 584d1b2927 Load circuit components from USB ports on demand, saving 0.5s of init time (0.7s on prod) (#69664)
We create 2,383 circuit components (on whatever map I was looking at on Sybil at the time, don't know) from USB ports every round, quite pricey. This makes them initialize once when a USB is first plugged in.
2022-09-03 17:22:45 -07:00
..
2022-04-01 21:07:46 -04:00
2022-08-25 20:13:36 -07:00
2022-06-01 19:41:46 -04:00
2022-06-16 22:36:10 +01:00
2022-08-05 09:32:02 +12:00
2022-08-23 21:17:30 +02:00
2022-08-30 20:28:11 -07:00
2022-08-05 09:32:02 +12:00
2022-04-01 21:07:46 -04:00
2022-08-05 09:32:02 +12: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