Exemple #1
0
        public void Step()
        {
            for (int i = 0; i < m_BTTrees.Count; i++)
            {
                BTTree   tree    = m_BTTrees[i];
                BTStatus pStatus = tree.Step();

                switch (pStatus)
                {
                case BTStatus.Initial:
                    break;

                case BTStatus.Running:
                    break;

                case BTStatus.Success:
                case BTStatus.Failure:
                {
                    m_DeleteList.Add(tree);
                }
                break;
                }
            }

            for (int i = 0; i < m_DeleteList.Count; i++)
            {
                BTTree tree = m_DeleteList[i];
                m_BTTrees.Remove(tree);
                tree.Clear();
            }
            m_DeleteList.Clear();
        }
Exemple #2
0
    public void Step()
    {
        for (int i = 0; i < mBTTrees.Count; i++)
        {
            BTTree    tree    = mBTTrees[i];
            EBTStatus pStatus = tree.Step();

            switch (pStatus)
            {
            case EBTStatus.BT_INITIAL:
                break;

            case EBTStatus.BT_RUNNING:
                break;

            case EBTStatus.BT_SUCCESS:
            case EBTStatus.BT_FAILURE:
            {
                mDeleteList.Add(tree);
            }
            break;
            }
        }

        for (int i = 0; i < mDeleteList.Count; i++)
        {
            BTTree tree = mDeleteList[i];
            mBTTrees.Remove(tree);
            tree.Clear();
        }
        mDeleteList.Clear();
    }