AngryAnt Behave - yield tick

So today I’m writing some extensions to AngryAnt Behave
http://angryant.com/behave/

Namely some implementations of various Decorators for easy re-use across libraries.

As well as something I thought would be useful. The ability to use ‘yield’ in your action/decorator ticks. As well as a collection of yield instructions similar to the coroutine yield instructions like WaitForSeconds.

This way you can write an action like so:

public System.Collections.IEnumerable YieldFooAction(Tree sender)
{
    //do some stuff

    yield return BehaveResult.Running;

    //do some more sutff NEXT tick

    yield return YieldForTicks(5);//wait 5 ticks

    //do even more stuff after 5 ticks of doing nothing

    yield return YieldForSeconds(1); //wait 1 second

    //finish up
}

You wouldn’t even have to return a final success because on completion it’s treated as a success.

What does everyone think? Would anyone like me to share this when I’m done?

Also share any decorators that you think would be useful. So far I just have generics like:

Repeat (repeat so many time)
TimedRepeat (repeat for so much time)
ExitIf (fails if parameter met)
ContinueIf (succeeds if parameter met)
Wait (blocks for so much time/ticks)

Well I just finished it all up.

Let me know if anyone is interested. I have to do some modifications to share it because I use some util classes from my existing codebase, which I’d have to refactor. So I’ll only do this work if people would like me to share it.

Some of my decorators and actions include:

These boolean checks can be set as the stringParam of the action/decorator. They’re processed by the decorator/action as a statement.

So I could have an Action of WaitUntil, and a stringParam of “(!aggressive || healthIsLow) isalive”. And it’ll wait until that statement evaluates to true (can be used to block in a sequence). The checking of each ‘prop’ is first passed to a method on the IAgent called ‘TestIf’, if that method doesn’t exist, or it returns null, then the ‘prop’ is reflected off the object itself.

Last bump before I let this die.

Any suggestions on Decorators or Actions?