Class EvergineExtensions
Extension methods to read and write Evergine types in or from a Lidgren.Network.NetBuffer.
Inherited Members
Namespace: Evergine.Networking.Connection.Messages
Assembly: Evergine.Networking.dll
Syntax
public static class EvergineExtensions
Methods
ReadColor(NetBuffer)
Reads a Color value from the Lidgren.Network.NetBuffer.
Declaration
public static Color ReadColor(this NetBuffer message)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to write to. |
Returns
Type | Description |
---|---|
Color | A Color value. |
ReadDateTime(NetBuffer)
Reads a DateTime value from the Lidgren.Network.NetBuffer using a 64 bits data.
Declaration
public static DateTime ReadDateTime(this NetBuffer message)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to write to. |
Returns
Type | Description |
---|---|
DateTime | A DateTime value. |
ReadMatrix3x3(NetBuffer)
Reads a Matrix3x3 value from the Lidgren.Network.NetBuffer.
Declaration
public static Matrix3x3 ReadMatrix3x3(this NetBuffer message)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to write to. |
Returns
Type | Description |
---|---|
Matrix3x3 | A Matrix3x3 value. |
ReadMatrix4x4(NetBuffer)
Reads a Matrix4x4 value from the Lidgren.Network.NetBuffer.
Declaration
public static Matrix4x4 ReadMatrix4x4(this NetBuffer message)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to write to. |
Returns
Type | Description |
---|---|
Matrix4x4 | A Matrix4x4 value. |
ReadNetworkEndpoint(NetBuffer)
Reads a NetworkEndpoint value from the Lidgren.Network.NetBuffer.
Declaration
public static NetworkEndpoint ReadNetworkEndpoint(this NetBuffer message)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to write to. |
Returns
Type | Description |
---|---|
NetworkEndpoint | A NetworkEndpoint value. |
ReadQuaternion(NetBuffer)
Reads a Quaternion value from the Lidgren.Network.NetBuffer.
Declaration
public static Quaternion ReadQuaternion(this NetBuffer message)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to write to. |
Returns
Type | Description |
---|---|
Quaternion | A Quaternion value. |
ReadTimeSpan(NetBuffer, bool)
Reads a TimeSpan value from the Lidgren.Network.NetBuffer.
Declaration
public static TimeSpan ReadTimeSpan(this NetBuffer message, bool highPrecision)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to write to. |
bool | highPrecision | Indicates whether the TimeSpan will be read using high precision (ticks) or not (milliseconds). |
Returns
Type | Description |
---|---|
TimeSpan | A TimeSpan value. |
Remarks
High precision allows full TimeSpan range, otherwise it will be limited to "+-24.20:31:23.647" (+-24 days, 20 hours, 31 minutes, 23 seconds and 647 milliseconds).
ReadVector2(NetBuffer)
Reads a Vector2 value from the Lidgren.Network.NetBuffer.
Declaration
public static Vector2 ReadVector2(this NetBuffer message)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to read from. |
Returns
Type | Description |
---|---|
Vector2 | A Vector2 value. |
ReadVector3(NetBuffer)
Reads a Vector3 value from the Lidgren.Network.NetBuffer.
Declaration
public static Vector3 ReadVector3(this NetBuffer message)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to read from. |
Returns
Type | Description |
---|---|
Vector3 | A Vector3 value. |
ReadVector4(NetBuffer)
Reads a Vector4 value from the Lidgren.Network.NetBuffer.
Declaration
public static Vector4 ReadVector4(this NetBuffer message)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to read from. |
Returns
Type | Description |
---|---|
Vector4 | A Vector4 value. |
Write(NetBuffer, Color)
Write a Color to the specified Lidgren.Network.NetBuffer.
Declaration
public static void Write(this NetBuffer message, Color value)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to write to. |
Color | value | The Color value. |
Write(NetBuffer, Matrix3x3)
Write a Matrix3x3 to the specified Lidgren.Network.NetBuffer.
Declaration
public static void Write(this NetBuffer message, Matrix3x3 value)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to write to. |
Matrix3x3 | value | The Matrix3x3 value. |
Write(NetBuffer, Matrix4x4)
Write a Matrix4x4 to the specified Lidgren.Network.NetBuffer.
Declaration
public static void Write(this NetBuffer message, Matrix4x4 value)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to write to. |
Matrix4x4 | value | The Matrix4x4 value. |
Write(NetBuffer, Quaternion)
Write a Quaternion to the specified Lidgren.Network.NetBuffer.
Declaration
public static void Write(this NetBuffer message, Quaternion value)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to write to. |
Quaternion | value | The Quaternion value. |
Write(NetBuffer, Vector2)
Write a Vector2 to the specified Lidgren.Network.NetBuffer.
Declaration
public static void Write(this NetBuffer message, Vector2 value)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to write to. |
Vector2 | value | The Vector2 value. |
Write(NetBuffer, Vector3)
Write a Vector3 to the specified Lidgren.Network.NetBuffer.
Declaration
public static void Write(this NetBuffer message, Vector3 value)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to write to. |
Vector3 | value | The Vector3 value. |
Write(NetBuffer, Vector4)
Write a Vector4 to the specified Lidgren.Network.NetBuffer.
Declaration
public static void Write(this NetBuffer message, Vector4 value)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to write to. |
Vector4 | value | The Vector4 value. |
Write(NetBuffer, NetworkEndpoint)
Write a NetworkEndpoint to the specified Lidgren.Network.NetBuffer.
Declaration
public static void Write(this NetBuffer message, NetworkEndpoint value)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to write to. |
NetworkEndpoint | value | The NetworkEndpoint value. |
Write(NetBuffer, DateTime)
Write a DateTime to the specified Lidgren.Network.NetBuffer using a 64 bits data.
Declaration
public static void Write(this NetBuffer message, DateTime value)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to write to. |
DateTime | value | The DateTime value. |
Write(NetBuffer, TimeSpan, bool)
Write a TimeSpan to the specified Lidgren.Network.NetBuffer.
Declaration
public static void Write(this NetBuffer message, TimeSpan value, bool highPrecision)
Parameters
Type | Name | Description |
---|---|---|
NetBuffer | message | The buffer to write to. |
TimeSpan | value | The TimeSpan value. |
bool | highPrecision | Indicates whether the TimeSpan will be written using high precision (ticks) or not (milliseconds). |
Remarks
High precision allows full TimeSpan range, otherwise it will be limited to "+-24.20:31:23.647" (+-24 days, 20 hours, 31 minutes, 23 seconds and 647 milliseconds).