예제 #1
0
        /// <summary>
        /// Helper for add new BehaviourTreeCondition node.
        /// </summary>
        /// <param name="condition">Condition.</param>
        public BehaviourTreeCondition <T> When <T> (BehaviourTreeNodeBase condition) where T : class, new ()
        {
            var node = new BehaviourTreeCondition <T> (condition);

            AddChild(node);
            return(node);
        }
예제 #2
0
 /// <summary>
 /// Adds child node to container.
 /// </summary>
 /// <returns>The child.</returns>
 /// <param name="node">Node.</param>
 public BehaviourTreeContainerBase AddChild(BehaviourTreeNodeBase node)
 {
     if (node != null)
     {
         Children.Add(node);
     }
     return(this);
 }
예제 #3
0
 /// <summary>
 /// Initialize new instance of BehaviourTreeCondition node.
 /// </summary>
 /// <param name="condition">Condition node.</param>
 /// <param name="successNode">Node for processing on successful condition.</param>
 public BehaviourTreeCondition(BehaviourTreeNodeBase condition, BehaviourTreeNodeBase successNode = null)
 {
     if (condition == null)
     {
         throw new ArgumentNullException();
     }
     _condition = condition;
     _node      = successNode;
 }
예제 #4
0
 /// <summary>
 /// Helper for add new BehaviourTreeAction node.
 /// </summary>
 /// <param name="node">Node.</param>
 public BehaviourTreeContainerBase Then(BehaviourTreeNodeBase node)
 {
     AddChild(node);
     return(this);
 }
예제 #5
0
 /// <summary>
 /// Set node for processing on successful condition.
 /// </summary>
 /// <param name="successNode">Node for processing on successful condition.</param>
 public BehaviourTreeCondition <T> Then(BehaviourTreeNodeBase successNode)
 {
     _node = successNode;
     return(this);
 }