This commit is contained in:
vis2k 2022-12-09 20:47:33 +01:00
parent 7b4e174d23
commit c994bb41b7

View File

@ -281,18 +281,6 @@ public static void WriteList<T>(this NetworkWriter writer, List<T> list)
writer.Write(list[i]); writer.Write(list[i]);
} }
public static void WriteArray<T>(this NetworkWriter writer, T[] array)
{
if (array is null)
{
writer.WriteInt(-1);
return;
}
writer.WriteInt(array.Length);
for (int i = 0; i < array.Length; i++)
writer.Write(array[i]);
}
public static void WriteHashSet<T>(this NetworkWriter writer, HashSet<T> hashSet) public static void WriteHashSet<T>(this NetworkWriter writer, HashSet<T> hashSet)
{ {
if (hashSet is null) if (hashSet is null)
@ -305,6 +293,17 @@ public static void WriteHashSet<T>(this NetworkWriter writer, HashSet<T> hashSet
writer.Write(item); writer.Write(item);
} }
public static void WriteArray<T>(this NetworkWriter writer, T[] array)
{
if (array is null)
{
writer.WriteInt(-1);
return;
}
writer.WriteInt(array.Length);
for (int i = 0; i < array.Length; i++)
writer.Write(array[i]);
}
public static void WriteUri(this NetworkWriter writer, Uri uri) public static void WriteUri(this NetworkWriter writer, Uri uri)
{ {