/// <summary>Reads a far position value.</summary> /// <param name="packet">The packet to read from.</param> /// <returns>The read value.</returns> /// <exception cref="PacketException">The packet has not enough available data for the read operation.</exception> public static FarPosition ReadFarPosition(this IReadablePacket packet) { FarPosition result; result.X = packet.ReadFarValue(); result.Y = packet.ReadFarValue(); return(result); }
/// <summary>Reads a far rectangle value.</summary> /// <param name="packet">The packet to read from.</param> /// <returns>The read value.</returns> /// <exception cref="PacketException">The packet has not enough available data for the read operation.</exception> public static FarRectangle ReadFarRectangle(this IReadablePacket packet) { FarRectangle result; result.X = packet.ReadFarValue(); result.Y = packet.ReadFarValue(); result.Width = packet.ReadSingle(); result.Height = packet.ReadSingle(); return(result); }
/// <summary>Reads a far value.</summary> /// <param name="packet">The packet to read from.</param> /// <param name="data">The read value.</param> /// <returns>This packet, for call chaining.</returns> /// <exception cref="PacketException">The packet has not enough available data for the read operation.</exception> public static IReadablePacket Read(this IReadablePacket packet, out FarValue data) { data = packet.ReadFarValue(); return(packet); }