예제 #1
0
            private EnumValueEnumerator(EnumArray <TEnum, TValue> array, int from, int to)
            {
                if (StaticLength == 0)
                {
                    elements = null;
                    iStart   = iEnd = iCurrent = -1;
                }
                else
                {
                    from = Mathf.Clamp(from, 0, StaticLength - 1);
                    to   = Mathf.Clamp(to, 0, StaticLength - 1);

                    if (from <= to)
                    {
                        iStart = iCurrent = from - 1;
                        iEnd   = to;
                    }
                    else
                    {
                        iStart = iCurrent = from + 1;
                        iEnd   = to;
                    }

                    array.FillCapacityToLength();
                    elements = array.elements;
                }
            }
예제 #2
0
 public void CopyFrom(EnumArray <TEnum, TValue> source)
 {
     if (ReferenceEquals(this, source))
     {
         return;
     }
     FillCapacityToLength();
     source.FillCapacityToLength();
     Array.Copy(source.elements, 0, elements, 0, StaticLength);
 }
예제 #3
0
 public static void Copy(EnumArray <TEnum, TValue> srcArray, int srcEnumValueIndex, EnumArray <TEnum, TValue> dstArray, int dstEnumValueIndex, int length)
 {
     srcArray.FillCapacityToLength();
     dstArray.FillCapacityToLength();
     Array.Copy(srcArray.elements, srcEnumValueIndex - StaticMinInt, dstArray.elements, dstEnumValueIndex - StaticMinInt, length);
 }