public void Depacketize(IReadablePacket packet) { if (packet.ReadBoolean()) { _start = packet.ReadFarPosition(); } }
/// <summary>Reads a world transform value.</summary> /// <param name="packet">The packet.</param> /// <returns>The read value.</returns> /// <exception cref="PacketException">The packet has not enough available data for the read operation.</exception> public static WorldTransform ReadWorldTransform(this IReadablePacket packet) { WorldTransform result; #if FARMATH result.Translation = packet.ReadFarPosition(); #else result.Translation = packet.ReadVector2(); #endif result.Rotation = packet.ReadRotation(); return(result); }
/// <summary>Reads a far position 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 FarPosition data) { data = packet.ReadFarPosition(); return(packet); }