Signals

by Kuraudo
Signals and slots truly make event-handling fun and intuitive!
ID:127249
 
What if you could simply tell your game that, when something happens, you want to simply send out an event saying "HEY!" and any other objects that are supposed to respond to these events (however many there may be) would automatically get the message? What about dynamically managing these connections, rather than hard-coding them in?

This is where signals & slots come in. Signals are these event messages you send out. Slots are procs you define for other objects (or the same object, if you're twisted) to receive the signal. Throw in a signal manager to handle the connections and you've got a very elegant solution to managing things! :]

Update 7/23/2009: Added /signal_mgr/signalsBlocked() and /signal_mgr/blockSignals(). See _notes.dm for more information.