Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CopyTo()

void System.Collections.Generic.SparseArrayBuilder< T >.CopyTo ( T[] array,
int arrayIndex,
int count )
inline

Definition at line 28 of file SparseArrayBuilder.cs.

29 {
30 int num = 0;
31 CopyPosition position = CopyPosition.Start;
32 for (int i = 0; i < _markers.Count; i++)
33 {
34 Marker marker = _markers[i];
35 int num2 = Math.Min(marker.Index - num, count);
36 if (num2 > 0)
37 {
38 position = _builder.CopyTo(position, array, arrayIndex, num2);
39 arrayIndex += num2;
40 num += num2;
41 count -= num2;
42 }
43 if (count == 0)
44 {
45 return;
46 }
47 int num3 = Math.Min(marker.Count, count);
48 arrayIndex += num3;
49 num += num3;
50 count -= num3;
51 }
52 if (count > 0)
53 {
54 _builder.CopyTo(position, array, arrayIndex, count);
55 }
56 }
System.Collections.Generic.ArrayBuilder< Marker > _markers

References System.Collections.Generic.SparseArrayBuilder< T >._builder, System.Collections.Generic.SparseArrayBuilder< T >._markers, System.array, System.arrayIndex, System.count, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Math.Min(), and System.Collections.Generic.CopyPosition.Start.

Referenced by System.Collections.Generic.SparseArrayBuilder< T >.ToArray().