Esempio n. 1
0
#pragma warning disable 0219
    public static void Test()
    {
        ViDoubleLink1 <int> list = new ViDoubleLink1 <int>();
        {
            ViDoubleLinkNode1 <int> node1 = new ViDoubleLinkNode1 <int>();
            ViDoubleLinkNode1 <int> node2 = new ViDoubleLinkNode1 <int>();
            list.PushBack(node1);
            list.PushBack(node2);

            {            ///<正向迭代>
                ViDoubleLinkNode1 <int> iter = list.GetHead();
                while (!list.IsEnd(iter))
                {
                    ViDoubleLink1 <int> .Next(ref iter);

                    ///<使用>
                    ///</使用>
                }
            }
            {            ///<反向迭代>
                ViDoubleLinkNode1 <int> iter = list.GetTail();
                while (!list.IsEnd(iter))
                {
                    ViDoubleLink1 <int> .Pre(ref iter);

                    ///<使用>
                    ///</使用>
                }
            }
        }
    }
Esempio n. 2
0
    //
    private static void _AddEvent(ViDoubleLink1 <ViTimeNodeInterface> list, ViTimeNodeInterface node)
    {
        ViDoubleLinkNode1 <ViTimeNodeInterface> iter = list.GetHead();

        while (!list.IsEnd(iter))
        {
            ViTimeNodeInterface timeNode = iter as ViTimeNodeInterface;
            ViDebuger.AssertError(timeNode);
            ViDoubleLink1 <ViTimeNodeInterface> .Next(ref iter);

            if (timeNode.Time > node.Time)
            {
                ViDoubleLink1 <ViTimeNodeInterface> .PushBefore(iter, node);

                return;
            }
        }
        list.PushBack(node);
    }
Esempio n. 3
0
    private static void _AddEvent(ViDoubleLink1 <ViTimeNodeInterface> list, TimeRoll timeRoll)
    {
        ViDoubleLinkNode1 <ViTimeNodeInterface> iter = list.GetHead();

        while (!list.IsEnd(iter))
        {
            ViTimeNodeInterface timeNode = iter as ViTimeNodeInterface;
            ViDebuger.AssertError(timeNode);
            ViDoubleLink1 <ViTimeNodeInterface> .Next(ref iter);

            if (timeRoll.InRange(timeNode.Time))
            {
                timeRoll.Add(timeNode);
            }
            else
            {
                break;
            }
        }
    }