Skip to content

Commit 44ea7d2

Browse files
committed
Add a shorthand method
1 parent 1431a9d commit 44ea7d2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Reactor/Networking/Serialization/MessageSerializer.cs

+8
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ public static void Serialize(this MessageWriter writer, object @object)
114114
}
115115
}
116116

117+
/// <summary>
118+
/// Deserializes a generic <typeparamref name="T"/> value from the <paramref name="reader"/>.
119+
/// </summary>
120+
/// <param name="reader">The <see cref="MessageReader"/> to read from.</param>
121+
/// <typeparam name="T">The type to be read.</typeparam>
122+
/// <returns>A generic <typeparamref name="T"/> value from the <paramref name="reader"/>.</returns>
123+
public static T Deserialize<T>(this MessageReader reader) => (T) reader.Deserialize(typeof(T));
124+
117125
/// <summary>
118126
/// Deserializes an <see cref="object"/> of <paramref name="objectType"/> from the <paramref name="reader"/>.
119127
/// </summary>

0 commit comments

Comments
 (0)