Ejemplo n.º 1
0
#pragma warning disable 0219
    public static void Test()
    {
        ViDoubleLink2 <int> list = new ViDoubleLink2 <int>();
        {
            ViDoubleLinkNode2 <int> node1 = new ViDoubleLinkNode2 <int>();
            node1.Data = 1;
            ViDoubleLinkNode2 <int> node2 = new ViDoubleLinkNode2 <int>();
            node2.Data = 2;
            list.PushBack(node1);
            list.PushBack(node2);

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

            {//<反向迭代>
                ViDoubleLinkNode2 <int> iter = list.GetTail();
                while (!list.IsEnd(iter))
                {
                    int value = iter.Data;
                    ViDoubleLink2 <int> .Pre(ref iter);
                }
            }
        }
    }
Ejemplo n.º 2
0
 //-------------------------------------------------------------------------
 void _AddToClose(ViAstarStep step)
 {
     step.State = ViAstarStepState.CLOSE;
     _closeList.PushBack(step.AttachNode);
 }
Ejemplo n.º 3
0
 //-------------------------------------------------------------------------
 void _AddToOpen(ViAstarStep step)
 {
     _openList.PushBack(step.AttachNode);
     step.State = ViAstarStepState.OPEN;
     _openHeap.Push(step);
 }
Ejemplo n.º 4
0
 protected void _AttachAsyn()
 {
     _node.Data = this;
     _AsynExecList.PushBack(_node);
 }