Esempio n. 1
0
        protected void testLockList()
        {
            LockList<string> m_list = new LockList<string>("TestLockList", 4);
            m_list.Add("aaaaa");
            m_list.Add("bbbbb");
            m_list.Add("ccccc");

            m_list.RemoveAt(1);
        }
Esempio n. 2
0
        public void ContainsFalseWorksForList()
        {
            var list = new LockList <int>();

            list.Add(150);
            list.Add(42);
            list.Add(978);

            list.Contains(420).Should().BeFalse();
        }
Esempio n. 3
0
        public void ListIndexer()
        {
            var list = new LockList <int>();

            list.Add(150);
            list.Add(42);
            list.Add(978);

            list[1].Should().Be(42);
        }
Esempio n. 4
0
        public void ListIndexOfTest()
        {
            var list = new LockList <int>();

            list.Add(150);
            list.Add(42);
            list.Add(978);

            list.IndexOf(42).Should().Be(1);
        }
Esempio n. 5
0
        protected void testLockList()
        {
            LockList <string> m_list = new LockList <string>("TestLockList", 4);

            m_list.Add("aaaaa");
            m_list.Add("bbbbb");
            m_list.Add("ccccc");

            m_list.RemoveAt(1);
        }
Esempio n. 6
0
        public void ClearRemovedAllItems()
        {
            var list = new LockList <int>();

            list.Add(150);
            list.Add(42);
            list.Add(978);
            list.Clear();

            list.Should().NotBeNull();
            list.Count.Should().Be(0);
        }
Esempio n. 7
0
        public void AddMultileItemsToList()
        {
            var list = new LockList <int>();

            list.Add(150);
            list.Add(7);
            list.Add(978);
            list.Add(35);
            list.Add(42);

            list.Should().NotBeNull();
            list.Count.Should().Be(5);
        }
Esempio n. 8
0
        public void RemoveWorksForList()
        {
            var list = new LockList <int>();

            list.Add(150);
            list.Add(7);
            list.Add(978);
            list.Add(35);
            list.Add(42);

            list.Remove(978).Should().BeTrue();
            list.Count.Should().Be(4);
        }
Esempio n. 9
0
        public void InsertWorks()
        {
            var list = new LockList <int>();

            list.Add(150);
            list.Add(42);
            list.Add(978);

            list.Insert(1, 99);
            list.Count.Should().Be(4);
            list[1].Should().Be(99);
            list[2].Should().Be(42);
        }
Esempio n. 10
0
        public void CopyToWorks()
        {
            var list = new LockList <int>();

            list.Add(150);
            list.Add(42);
            list.Add(978);

            var list2 = new int[3];

            list.CopyTo(list2, 0);

            list2.Length.Should().Be(3);
            list2[0].Should().Be(150);
            list2[1].Should().Be(42);
            list2[2].Should().Be(978);
        }
Esempio n. 11
0
        public void AddSingleItemToList()
        {
            var list = new LockList <int>();

            list.Add(150);

            list.Should().NotBeNull();
            list.Count.Should().Be(1);
        }
Esempio n. 12
0
        /// <summary>
        /// (Cross-Game compatible) Return a duplicate of this
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="list"></param>
        /// <returns></returns>
        public static LockList <T> Duplicate <T>(this LockList <T> list)
        {
            LockList <T> newList = new LockList <T>();

            for (int i = 0; i < list.Count; i++)
            {
                newList.Add(list[i]);
            }

            return(newList);
        }
Esempio n. 13
0
        /// <summary>
        /// Not Tested
        /// </summary>
        public static LockList <T> ToLockList <T>(this List <T> list)
        {
            LockList <T> lockList = new LockList <T>();

            foreach (T item in list)
            {
                lockList.Add(item);
            }

            return(lockList);
        }
Esempio n. 14
0
        /// <summary>
        /// Not Tested
        /// </summary>
        public static LockList <T> ToLockList <T>(this Il2CppReferenceArray <T> referenceArray) where T : Il2CppSystem.Object
        {
            LockList <T> lockList = new LockList <T>();

            foreach (T item in referenceArray)
            {
                lockList.Add(item);
            }

            return(lockList);
        }
        /// <summary>
        /// (Cross-Game compatible) Return as LockList
        /// </summary>
        public static LockList <Il2CppSystem.Object> ToLockList(this IEnumerator enumerator)
        {
            LockList <Il2CppSystem.Object> lockList = new LockList <Il2CppSystem.Object>();

            while (enumerator.MoveNext())
            {
                lockList.Add(enumerator.Current);
            }

            return(lockList);
        }
Esempio n. 16
0
        /// <summary>
        /// Not Tested
        /// </summary>
        public static LockList <T> ToLockList <T>(this SizedList <T> sizedList)
        {
            LockList <T> lockList = new LockList <T>();

            for (int i = 0; i < sizedList.count; i++)
            {
                lockList.Add(sizedList[i]);
            }

            return(lockList);
        }
Esempio n. 17
0
        /// <summary>
        /// (Cross-Game compatible) Return as LockList
        /// </summary>
        public static LockList <T> ToLockList <T>(this IEnumerable <T> enumerable)
        {
            LockList <T> lockList = new LockList <T>();

            for (int i = 0; i < enumerable.Count(); i++)
            {
                lockList.Add(enumerable.ElementAt(i));
            }

            return(lockList);
        }
Esempio n. 18
0
        /// <summary>
        /// (Cross-Game compatible) Return a duplicate of this as type TCast
        /// </summary>
        /// <typeparam name="TSource"></typeparam>
        /// <typeparam name="TCast"></typeparam>
        /// <param name="list"></param>
        /// <returns></returns>
        public static LockList <TCast> DuplicateAs <TSource, TCast>(this LockList <TSource> list)
            where TSource : Il2CppSystem.Object where TCast : Il2CppSystem.Object
        {
            LockList <TCast> newList = new LockList <TCast>();

            for (int i = 0; i < list.Count; i++)
            {
                newList.Add(list[i].TryCast <TCast>());
            }

            return(newList);
        }
        /// <summary>
        /// (Cross-Game compatible) Return as LockList
        /// </summary>
        public static LockList <T> ToLockList <T>(this IEnumerable <T> enumerable) where T : Il2CppSystem.Object
        {
            LockList <T> lockList   = new LockList <T>();
            var          enumerator = enumerable.GetEnumeratorCollections();

            while (enumerator.MoveNext())
            {
                lockList.Add(enumerator.Current.Cast <T>());
            }

            return(lockList);
        }
Esempio n. 20
0
 public void push(T item)
 {
     m_list.Add(item);
 }