예제 #1
0
 public void Depacketize(IReadablePacket packet)
 {
     if (packet.ReadBoolean())
     {
         _start = packet.ReadFarPosition();
     }
 }
예제 #2
0
        /// <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);
        }
예제 #3
0
 /// <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);
 }