Skip to main content

Class CollectionExtensions

Inheritance
System.Object
Inherited Members
Show
Syntax
public static class CollectionExtensions

Methods

WriteBytesAndSize(NetworkWriter, Byte[], Int32, Int32)

For byte arrays with dynamic size, where the reader doesn't know how many will come

Declaration
public static void WriteBytesAndSize(this NetworkWriter writer, byte[] buffer, int offset, int count)
Parameters
TypeNameDescription
Mirage.Serialization.NetworkWriterwriter
System.Byte[]bufferarray or null
System.Int32offset
System.Int32count

WriteBytesAndSize(NetworkWriter, Byte[])

Write method for weaver to use

Declaration
public static void WriteBytesAndSize(this NetworkWriter writer, byte[] buffer)
Parameters
TypeNameDescription
Mirage.Serialization.NetworkWriterwriter
System.Byte[]bufferarray or null

WriteBytesAndSizeSegment(NetworkWriter, ArraySegment<Byte>)

Declaration
public static void WriteBytesAndSizeSegment(this NetworkWriter writer, ArraySegment<byte> buffer)
Parameters
TypeNameDescription
Mirage.Serialization.NetworkWriterwriter
System.ArraySegment<System.Byte>buffer

WriteList<T>(NetworkWriter, List<T>)

Declaration
[WeaverSerializeCollection]
public static void WriteList<T>(this NetworkWriter writer, List<T> list)
Parameters
TypeNameDescription
Mirage.Serialization.NetworkWriterwriter
System.Collections.Generic.List<T>list

WriteArray<T>(NetworkWriter, T[])

Declaration
public static void WriteArray<T>(this NetworkWriter writer, T[] array)
Parameters
TypeNameDescription
Mirage.Serialization.NetworkWriterwriter
{T}[]array

WriteArraySegment<T>(NetworkWriter, ArraySegment<T>)

Declaration
[WeaverSerializeCollection]
public static void WriteArraySegment<T>(this NetworkWriter writer, ArraySegment<T> segment)
Parameters
TypeNameDescription
Mirage.Serialization.NetworkWriterwriter
System.ArraySegment<T>segment

WriteDictionary<TKey, TValue>(NetworkWriter, Dictionary<TKey, TValue>)

Declaration
[WeaverSerializeCollection]
public static void WriteDictionary<TKey, TValue>(this NetworkWriter writer, Dictionary<TKey, TValue> dictionary)
Parameters
TypeNameDescription
Mirage.Serialization.NetworkWriterwriter
System.Collections.Generic.Dictionary<TKey, TValue>dictionary

ReadBytesAndSize(NetworkReader)

Declaration
public static byte[] ReadBytesAndSize(this NetworkReader reader)
Parameters
TypeNameDescription
Mirage.Serialization.NetworkReaderreader
Returns
TypeDescription
System.Byte[]array or null

ReadBytesAndSizeSegment(NetworkReader)

Declaration
public static ArraySegment<byte> ReadBytesAndSizeSegment(this NetworkReader reader)
Parameters
TypeNameDescription
Mirage.Serialization.NetworkReaderreader
Returns
TypeDescription
System.ArraySegment<System.Byte>

ReadBytes(NetworkReader, Int32)

Declaration
public static byte[] ReadBytes(this NetworkReader reader, int count)
Parameters
TypeNameDescription
Mirage.Serialization.NetworkReaderreader
System.Int32count
Returns
TypeDescription
System.Byte[]

ReadList<T>(NetworkReader)

Declaration
[WeaverSerializeCollection]
public static List<T> ReadList<T>(this NetworkReader reader)
Parameters
TypeNameDescription
Mirage.Serialization.NetworkReaderreader
Returns
TypeDescription
System.Collections.Generic.List<T>

ReadArray<T>(NetworkReader)

Declaration
public static T[] ReadArray<T>(this NetworkReader reader)
Parameters
TypeNameDescription
Mirage.Serialization.NetworkReaderreader
Returns
TypeDescription
{T}[]

ReadArraySegment<T>(NetworkReader)

Declaration
[WeaverSerializeCollection]
public static ArraySegment<T> ReadArraySegment<T>(this NetworkReader reader)
Parameters
TypeNameDescription
Mirage.Serialization.NetworkReaderreader
Returns
TypeDescription
System.ArraySegment<T>

ReadDictionary<TKey, TValue>(NetworkReader)

Declaration
[WeaverSerializeCollection]
public static Dictionary<TKey, TValue> ReadDictionary<TKey, TValue>(this NetworkReader reader)
Parameters
TypeNameDescription
Mirage.Serialization.NetworkReaderreader
Returns
TypeDescription
System.Collections.Generic.Dictionary<TKey, TValue>