DragonECS-Graphs/src/Utils/ArrayUtility.cs

19 lines
488 B
C#
Raw Normal View History

2023-06-19 01:36:36 +08:00
using System;
using System.Runtime.InteropServices;
namespace DCFApixels.DragonECS.Relations.Utils
{
internal static class ArrayUtility
{
public static void Fill<T>(T[] array, T value, int startIndex = 0, int length = -1)
{
if (length < 0)
length = array.Length;
else
length = startIndex + length;
for (int i = startIndex; i < length; i++)
array[i] = value;
}
}
}