[MIRROR] SendSignal() speedup (#2910)

* SendSignal() speedup (#30929)

* Rename component.dm to _component.dm

* Merges RecieveSignal() into SendSignal()

* Makes ComponentActivated() and AfterComponentActivated() async

* SendSignal() speedup
This commit is contained in:
CitadelStationBot
2017-09-23 05:53:23 -05:00
committed by Poojawa
parent 51d8182b13
commit 442689219e
3 changed files with 23 additions and 20 deletions
+2 -5
View File
@@ -62,7 +62,7 @@ Stands have a lot of procs which mimic mob procs. Rather than inserting hooks fo
* Returns the component that was created. Or the old component in a dupe situation where `COMPONENT_DUPE_UNIQUE` was set
1. `/datum/proc/LoadComponent(component_type(type), ...) -> datum/component` (public, final)
* Equivalent to calling `GetComponent(component_type)` where, if the result would be `null`, returns `AddComponent(component_type, ...)` instead
1. `/datum/proc/ComponentActivated(datum/component/C)` (abstract)
1. `/datum/proc/ComponentActivated(datum/component/C)` (abstract, async)
* Called on a component's `parent` after a signal recieved causes it to activate. `src` is the parameter
* Will only be called if a component's callback returns `TRUE`
1. `/datum/proc/TakeComponent(datum/component/C)` (public, final)
@@ -87,7 +87,7 @@ Stands have a lot of procs which mimic mob procs. Rather than inserting hooks fo
* Called on a component when a component of the same type was added to the same parent
* See `/datum/component/var/dupe_mode`
* `C`'s type will always be the same of the called component
1. `/datum/component/proc/AfterComponentActivated()` (abstract)
1. `/datum/component/proc/AfterComponentActivated()` (abstract, async)
* Called on a component that was activated after it's `parent`'s `ComponentActivated()` is called
1. `/datum/component/proc/OnTransfer(datum/new_parent)` (abstract, no-sleep)
* Called before the new `parent` is assigned in `TakeComponent()`, after the remove signal, before the added signal
@@ -101,8 +101,5 @@ Stands have a lot of procs which mimic mob procs. Rather than inserting hooks fo
* If a previous registration is overwritten by the call, a runtime occurs. Setting `override` to TRUE prevents this
* These callbacks run asyncronously
* Returning `TRUE` from these callbacks will trigger a `TRUE` return from the `SendSignal()` that initiated it
1. `/datum/component/proc/ReceiveSignal(signal, ...)` (virtual)
* Called when a component recieves any signal and is enabled
* Default implementation looks if the signal is registered and runs the appropriate proc
### See/Define signals and their arguments in __DEFINES\components.dm