DragonECS/src/Utils/ArrayUtility.cs

22 lines
503 B
C#
Raw Normal View History

2023-04-08 00:47:35 +08:00
namespace DCFApixels.DragonECS
{
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;
}
}
}
}