Example #1
0
 public void AddRange(BetterLinkedList <T> list)
 {
     end.SetNext(list.start);
     end     = list.end;
     current = list.end;
     Count  += list.Count;
 }
Example #2
0
 void TestForeach <T>(BetterLinkedList <T> list)
 {
     foreach (BetterLinkedListNode <T> cur in list)
     {
         // 说明:用于正确性测试;测试GC时需要注释
         //Debug.Log("TestForeach:" + cur.Value.ToString());
     }
 }
Example #3
0
    void TestGetEnumerator <T>(BetterLinkedList <T> list)
    {
        var item = list.GetEnumerator();

        while (item.MoveNext())
        {
            // 说明:用于正确性测试;测试GC时需要注释
            //Debug.Log("TestGetEnumerator:" + (item.Current as BetterLinkedListNode<T>).Value.ToString());
        }
    }
Example #4
0
 // Use this for initialization
 void Start()
 {
     mBetterLinkedList1 = new BetterLinkedList <int>();
     mBetterLinkedList2 = new BetterLinkedList <string>();
     mBetterLinkedList3 = new BetterLinkedList <CustomStruct>();
     mBetterLinkedList4 = new BetterLinkedList <CustomClass>();
     mBsb = new BetterStringBuilder(30, 0, BetterStringBuilderBufferType.None);
     for (int i = 0; i < 100; i++)
     {
         mTestString.Add("test" + i.ToString());
         mTestCustomStruct.Add(new CustomStruct(i, mTestString[i]));
         mTestCustomClass.Add(new CustomClass(i, mTestString[i], mTestCustomStruct[i]));
     }
 }
Example #5
0
    void LogList <T>(BetterLinkedList <T> list)
    {
        // 说明:用于测试正确性
        mBsb.Clear();
        mBsb.AppendFormat("---------------------  {0}", typeof(T).Name);
        mBsb.AppendLine();
        mBsb.AppendFormat("Count = {0}", list.Count);
        mBsb.AppendLine();
        BetterLinkedListNode <T> node = list.First;

        while (node != null)
        {
            mBsb.Append(node.Value.ToString());
            mBsb.AppendLine();
            node = node.Next;
        }
        mBsb.AppendLine();
        Debug.Log(mBsb.ToString());
    }
Example #6
0
    public BetterLinkedList <Vector4> GetPooledLinkedListVector4(Vector4 a, Vector4 b, Vector4 c)
    {
        int size = poolingLinkedListVector4.Count;

        BetterLinkedList <Vector4> toBeReturned;

        if (size == 0)
        {
            toBeReturned = new BetterLinkedList <Vector4>();
        }
        else
        {
            toBeReturned = poolingLinkedListVector4[size - 1];
            poolingLinkedListVector4.RemoveAt(size - 1);
        }

        toBeReturned.Add(a);
        toBeReturned.Add(b);
        toBeReturned.Add(c);

        return(toBeReturned);
    }
Example #7
0
 void TestAddAfter <T>(BetterLinkedList <T> list, BetterLinkedListNode <T> node, BetterLinkedListNode <T> newNode)
 {
     list.AddAfter(node, newNode);
 }
Example #8
0
 void TestClear <T>(BetterLinkedList <T> list)
 {
     list.Clear();
 }
Example #9
0
    BetterLinkedListNode <T> TestFind <T>(BetterLinkedList <T> list, T value)
    {
        BetterLinkedListNode <T> node = list.Find(value);

        return(node);
    }
Example #10
0
 void TestRemoveNode <T>(BetterLinkedList <T> list, BetterLinkedListNode <T> node)
 {
     list.Remove(node);
 }
Example #11
0
 void TestRemoveValue <T>(BetterLinkedList <T> list, T value)
 {
     list.Remove(value);
 }
Example #12
0
 void TestRemoveLast <T>(BetterLinkedList <T> list)
 {
     list.RemoveLast();
 }
Example #13
0
 public void PoolList(BetterLinkedList <Vector4> dedList)
 {
     dedList.Clear();
     poolingLinkedListVector4.Add(dedList);
 }
Example #14
0
 void TestAddLast <T>(BetterLinkedList <T> list, T item)
 {
     list.AddLast(item);
 }
Example #15
0
 void TestAddAfter <T>(BetterLinkedList <T> list, BetterLinkedListNode <T> node, T item)
 {
     list.AddAfter(node, item);
 }
Example #16
0
 void TestAddBefore <T>(BetterLinkedList <T> list, BetterLinkedListNode <T> node, BetterLinkedListNode <T> newNode)
 {
     list.AddBefore(node, newNode);
 }
Example #17
0
 void TestAddBefore <T>(BetterLinkedList <T> list, BetterLinkedListNode <T> node, T item)
 {
     list.AddBefore(node, item);
 }