예제 #1
0
파일: ListX.cs 프로젝트: weichx/SpaceGame
 void IList.Remove(object item)
 {
     if (!ListX <T> .IsCompatibleObject(item))
     {
         return;
     }
     this.Remove((T)item);
 }
예제 #2
0
파일: ListX.cs 프로젝트: weichx/SpaceGame
 public int IndexOf(object item)
 {
     if (ListX <T> .IsCompatibleObject(item))
     {
         return(this.IndexOf((T)item));
     }
     return(-1);
 }
예제 #3
0
파일: ListX.cs 프로젝트: weichx/SpaceGame
        public ListX <T> GetRange(int index, int count)
        {
            ListX <T> objListX = new ListX <T>(count);

            Array.Copy((Array)this._items, index, (Array)objListX._items, 0, count);
            objListX._size = count;
            return(objListX);
        }
예제 #4
0
파일: ListX.cs 프로젝트: weichx/SpaceGame
 bool IList.Contains(object item)
 {
     if (ListX <T> .IsCompatibleObject(item))
     {
         return(this.Contains((T)item));
     }
     return(false);
 }
예제 #5
0
파일: ListX.cs 프로젝트: weichx/SpaceGame
        public ListX <V> Map <U, V>(U target, Func <T, U, V> mapFn)
        {
            ListX <V> retn = new ListX <V>(_size);

            for (int i = 0; i < _size; i++)
            {
                retn.Add(mapFn(_items[i], target));
            }
            return(retn);
        }
예제 #6
0
파일: ListX.cs 프로젝트: weichx/SpaceGame
        public ListX <U> Map <U>(Func <T, U> mapFn)
        {
            ListX <U> retn = new ListX <U>(_size);

            for (int i = 0; i < _size; i++)
            {
                retn.Add(mapFn(_items[i]));
            }
            return(retn);
        }
예제 #7
0
파일: ListX.cs 프로젝트: weichx/SpaceGame
        public ListX <T> FindAll(Predicate <T> match)
        {
            ListX <T> objListX = new ListX <T>();

            for (int index = 0; index < this._size; ++index)
            {
                if (match(this._items[index]))
                {
                    objListX.Add(this._items[index]);
                }
            }
            return(objListX);
        }
예제 #8
0
파일: ListX.cs 프로젝트: weichx/SpaceGame
        public ListX <T> FindAll <U>(U target, Func <T, U, bool> predicate)
        {
            ListX <T> retn   = new ListX <T>(4);
            int       length = _size;

            for (int i = 0; i < length; i++)
            {
                if (predicate(_items[i], target))
                {
                    retn.Add(_items[i]);
                }
            }
            return(retn);
        }
예제 #9
0
파일: ListX.cs 프로젝트: weichx/SpaceGame
 internal Enumerator(ListX <T> listX)
 {
     this.listX   = listX;
     this.index   = 0;
     this.current = default(T);
 }