using RebootKit.Engine.Simulation;

namespace RebootKit.Engine.AI {
    public class BehaviourTree : BehaviourNode {
        public BehaviourTree(string name) : base(name) {
        }

        public override Status Process(Actor target, float dt) {
            while (m_CurrentChild < Children.Count) {
                Status status = Children[m_CurrentChild].Process(target, dt);
                if (status != Status.Success) {
                    return status;
                }
                
                m_CurrentChild += 1;
            }
            
            return Status.Success;
        }
    }
}