active-logic / activelogic-cs

Behavior Trees and Case Logic for C#7
GNU Affero General Public License v3.0
106 stars 7 forks source link

tie / @while operator #27

Closed eelstork closed 3 years ago

eelstork commented 4 years ago

Commonly known composites effect the next task if the prior task has succeeded (sequence) or failed (selector); although I initially did not see a use for this the alternative effects the next task while the prior task is running. For example:

1 - play an animation (walk) @while moving forward. 2 - keep a light on while there is power

So, in some cases the result of A ⨀ B is independent of B, in others, such as when B represents a needed resource, failing B will also fail A.

Ideally this would implementing using shorting operators. With C# shorting operators are exhausted (there are 2); decorators may be used.

eelstork commented 3 years ago

c71bb04910e85575a6b2f98ac5fb3a2590808077