예제 #1
0
        public T this[int index]
        {
            //实现索引器的get方法
            get
            {
                if (!IsValidIndex(index))
                {
                    throw new IndexOutOfRangeException();
                }
                return(UObject.WrapObject <T>(Marshal.ReadIntPtr(FScriptArray.GetData(ref InterArray) + IntPtr.Size * index)));
            }

            //实现索引器的set方法
            set
            {
                if (!IsValidIndex(index))
                {
                    throw new IndexOutOfRangeException();
                }

                Marshal.WriteIntPtr(FScriptArray.GetData(ref InterArray) + IntPtr.Size * index, value != null? value._this.Get():IntPtr.Zero);
            }
        }
예제 #2
0
        public T this[int index]
        {
            //实现索引器的get方法
            get
            {
                if (!IsValidIndex(index))
                {
                    throw new IndexOutOfRangeException();
                }
                return((T)Marshal.PtrToStructure(FScriptArray.GetData(ref InterArray) + Marshal.SizeOf(typeof(T)) * index, typeof(T)));
            }

            //实现索引器的set方法
            set
            {
                if (!IsValidIndex(index))
                {
                    throw new IndexOutOfRangeException();
                }

                Marshal.StructureToPtr(value, FScriptArray.GetData(ref InterArray) + Marshal.SizeOf(typeof(T)) * index, false);
            }
        }
예제 #3
0
 public static extern void Empty(ref FScriptArray _this, int Slack, int NumBytesPerElement);
예제 #4
0
 public static extern int AddZerod(ref FScriptArray _this, int Count, int NumBytesPerElement);
예제 #5
0
 public static extern void Shrink(ref FScriptArray _this, int NumBytesPerElement);
예제 #6
0
 public void Empty(int Slack)
 {
     FScriptArray.Empty(ref InterArray, Slack, IntPtr.Size);
 }
예제 #7
0
 public void Remove(int Index, int Count)
 {
     FScriptArray.Remove(ref InterArray, Index, Count, IntPtr.Size);
 }
예제 #8
0
 public int AddZerod(int Count)
 {
     return(FScriptArray.AddZerod(ref InterArray, Count, IntPtr.Size));
 }
예제 #9
0
 public void Shrink()
 {
     FScriptArray.Shrink(ref InterArray, IntPtr.Size);
 }
예제 #10
0
 public static extern void Remove(ref FScriptArray _this, int Index, int Count, int NumBytesPerElement);
예제 #11
0
 public void Insert(int Index, int Count)
 {
     FScriptArray.Insert(ref InterArray, Index, Count, Marshal.SizeOf(typeof(T)));
 }
예제 #12
0
 public static extern void InsertZeroed(ref FScriptArray _this, int Index, int Count, int NumBytesPerElement);
예제 #13
0
 public TObjectArray(FScriptArray ScriptArray)
 {
     InterArray = ScriptArray;
 }
예제 #14
0
 public void Remove(int Index, int Count)
 {
     FScriptArray.Remove(ref InterArray, Index, Count, Marshal.SizeOf(typeof(T)));
 }
예제 #15
0
 public void Empty(int Slack)
 {
     FScriptArray.Empty(ref InterArray, Slack, Marshal.SizeOf(typeof(T)));
 }
예제 #16
0
 public void Shrink()
 {
     FScriptArray.Shrink(ref InterArray, Marshal.SizeOf(typeof(T)));
 }
예제 #17
0
 public int AddZerod(int Count)
 {
     return(FScriptArray.AddZerod(ref InterArray, Count, Marshal.SizeOf(typeof(T))));
 }
예제 #18
0
 public static extern IntPtr GetData(ref FScriptArray _this);
예제 #19
0
 public TStructArray(FScriptArray ScriptArray)
 {
     InterArray = ScriptArray;
 }
예제 #20
0
 public void Insert(int Index, int Count)
 {
     FScriptArray.Insert(ref InterArray, Index, Count, IntPtr.Size);
 }