mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-19 10:34:37 +08:00
22 lines
503 B
C#
22 lines
503 B
C#
![]() |
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;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|