예제 #1
0
        //-------------------------------------------------------------------------
        public static void Test()
        {
            EbDoubleLinkList2 <int> list  = new EbDoubleLinkList2 <int>();
            EbDoubleLinkNode2 <int> node1 = new EbDoubleLinkNode2 <int>();

            node1.Data = 1;
            EbDoubleLinkNode2 <int> node2 = new EbDoubleLinkNode2 <int>();

            node2.Data = 2;
            list.PushBack(node1);
            list.PushBack(node2);

            {// 正向迭代
                EbDoubleLinkNode2 <int> iter = list.GetHead();
                while (!list.IsEnd(iter))
                {
                    int value = iter.Data;
                    EbDoubleLinkList2 <int> .Next(ref iter);
                }
            }

            {// 反向迭代
                EbDoubleLinkNode2 <int> iter = list.GetTail();
                while (!list.IsEnd(iter))
                {
                    int value = iter.Data;
                    EbDoubleLinkList2 <int> .Pre(ref iter);
                }
            }
        }
예제 #2
0
 //---------------------------------------------------------------------
 public void Delete(EbDoubleLinkNode2 <T> node)
 {
     if (node != null)
     {
         mListNode.PushBack(node);
     }
 }
예제 #3
0
        //---------------------------------------------------------------------
        public void Append(EbVector3 pos)
        {
            EbDoubleLinkNode2 <EbRouteNode> node = mNodeAlloc.New();

            node.Data._eventId = EbRouteNode.NULL_EVENT;
            node.Data._pos     = pos;
            mListNode.PushBack(node);
        }
예제 #4
0
 //---------------------------------------------------------------------
 void _AddToClose(EbAstarStep step)
 {
     step.State = _eEbAstarStepState.CLOSE;
     mCloseList.PushBack(step.AttachNode);
 }
예제 #5
0
 //---------------------------------------------------------------------
 void _AddToOpen(EbAstarStep step)
 {
     mOpenList.PushBack(step.AttachNode);
     step.State = _eEbAstarStepState.OPEN;
     mOpenHeap.Push(step);
 }