FluentBehaviourTree.BehaviourTreeBuilder.Do C# (CSharp) Method

Do() public method

Create an action node.
public Do ( string name, BehaviourTreeStatus>.Func fn ) : BehaviourTreeBuilder
name string
fn BehaviourTreeStatus>.Func
return BehaviourTreeBuilder
        public BehaviourTreeBuilder Do(string name, Func<TimeData, BehaviourTreeStatus> fn)
        {
            if (parentNodeStack.Count <= 0)
            {
                throw new ApplicationException("Can't create an unnested ActionNode, it must be a leaf node.");
            }

            var actionNode = new ActionNode(name, fn);
            parentNodeStack.Peek().AddChild(actionNode);
            return this;
        }