//------------------------------------------------------------------------- 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); } } }
//--------------------------------------------------------------------- public void Delete(EbDoubleLinkNode2 <T> node) { if (node != null) { mListNode.PushBack(node); } }
//--------------------------------------------------------------------- public void Append(EbVector3 pos) { EbDoubleLinkNode2 <EbRouteNode> node = mNodeAlloc.New(); node.Data._eventId = EbRouteNode.NULL_EVENT; node.Data._pos = pos; mListNode.PushBack(node); }
//--------------------------------------------------------------------- void _AddToClose(EbAstarStep step) { step.State = _eEbAstarStepState.CLOSE; mCloseList.PushBack(step.AttachNode); }
//--------------------------------------------------------------------- void _AddToOpen(EbAstarStep step) { mOpenList.PushBack(step.AttachNode); step.State = _eEbAstarStepState.OPEN; mOpenHeap.Push(step); }