Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
en:toolworks:docs:apparatus:deferred [2022/05/31 18:13] – vladius | en:toolworks:docs:apparatus:deferred [2022/06/05 21:40] – vladius | ||
---|---|---|---|
Line 48: | Line 48: | ||
====== Despawning Subjects ====== | ====== Despawning Subjects ====== | ||
- | The process of destroying a Subject is quite analogous. Kill all units once their health is zero or below. Just do:<code cpp> | + | The process of destroying a Subject is quite analogous. Kill all units once their health is zero or below. Just do something like:<code cpp> |
SolidChain-> | SolidChain-> | ||
{ | { | ||
Line 58: | Line 58: | ||
</ | </ | ||
+ | ====== Applying ===== | ||
+ | |||
+ | Until when? This is quite a logical question when dealing with something that is deferred by design. And the default answer is "when the time is right" | ||
+ | |||
+ | The default automatic behavior minimizes the effort and guarantees that the Deferreds get applied accordingly, | ||
+ | |||
+ | Deferreds Applicators are created explicitly, by calling the [[appi> | ||
+ | { // Start of the explicit scope. | ||
+ | auto Applicator = Mechanism-> | ||
+ | Mechanism-> | ||
+ | // Your first mechanic producing deferred operations. | ||
+ | }); | ||
+ | // The Deferreds won't be applied at this point. | ||
+ | Mechanism-> | ||
+ | // Your second mechanic producing deferred operations. | ||
+ | }); | ||
+ | // Now the Deferreds get actually applied. | ||
+ | } // End of the explicit scope. | ||
+ | </ | ||
+ | |||
+ | Note that the Applicator is actually introduced within its own explicit scope (the curly brace' |