protected override Status DoTick()
        {
            Status status = m_child.Tick();

            if (status != Status.Running)
            {
                status = status == Status.Succeeded ? Status.Failed : Status.Succeeded;
            }

            return(status);
        }
Exemple #2
0
        protected override Status DoTick()
        {
            Status status = m_child.Tick();

            if (status == Status.Failed)
            {
                status = Status.Succeeded;
            }

            return(status);
        }
        protected override Status DoTick()
        {
            Status status = Status.Failed;

            /*
             * string str = "";
             * foreach (var w in indexWeights)
             *  str += string.Format("{0:0.00}-", w.weight);
             * this.debugInfo = str;
             */

            if (areValidWeights)
            {
                status = m_selectedChild.Tick();
            }

            return(status);
        }
        protected override Status DoTick()
        {
            Status status = Status.Failed;

            if (this.m_status == Status.Failed)
            {
                return(Status.Failed);
            }

            do
            {
                status = m_current.Tick();
                if (status == Status.Failed)
                {
                    ++_idx;
                    var children = this.children;
                    m_current = _idx < children.Length ? children[_idx] : null;
                }
            } while(m_current != null && (status == Status.Failed));

            return(status);
        }
Exemple #5
0
        protected override Status DoTick()
        {
            Status status = Status.Failed;

            do
            {
                status = m_current.Tick();

                if (status == Status.Succeeded)
                {
                    ++_idx;
                    var children = this.children;
                    m_current = _idx < children.Length ?  children[_idx] : null;
                }
            }while(status == Status.Succeeded && m_current != null);

            if (status == Status.Succeeded && m_current != null)
            {
                status = Status.Running;
            }

            return(status);
        }