コード例 #1
0
        /// <summary>
        /// Creates a new pit stop packet.
        /// </summary>
        /// <param name="buffer">A buffer contaning the packet data.</param>
        public IS_PIT(byte[] buffer)
            : this()
        {
            PacketReader reader = new PacketReader(buffer);

            Size     = reader.ReadByte();
            Type     = (PacketType)reader.ReadByte();
            ReqI     = reader.ReadByte();
            PLID     = reader.ReadByte();
            LapsDone = reader.ReadUInt16();
            Flags    = (PlayerFlags)reader.ReadUInt16();
            reader.Skip(1);
            Penalty  = (PenaltyValue)reader.ReadByte();
            NumStops = reader.ReadByte();
            reader.Skip(1);
            Tyres = new Tyres(
                (TyreCompound)reader.ReadByte(),
                (TyreCompound)reader.ReadByte(),
                (TyreCompound)reader.ReadByte(),
                (TyreCompound)reader.ReadByte());
            Work = (PitWorkFlags)reader.ReadUInt32();
        }
コード例 #2
0
 /// <summary>
 /// Creates a new pit stop packet.
 /// </summary>
 /// <param name="buffer">A buffer contaning the packet data.</param>
 public IS_PIT(byte[] buffer)
     : this() {
     PacketReader reader = new PacketReader(buffer);
     Size = reader.ReadByte();
     Type = (PacketType)reader.ReadByte();
     ReqI = reader.ReadByte();
     PLID = reader.ReadByte();
     LapsDone = reader.ReadUInt16();
     Flags = (PlayerFlags)reader.ReadUInt16();
     reader.Skip(1);
     Penalty = (PenaltyValue)reader.ReadByte();
     NumStops = reader.ReadByte();
     reader.Skip(1);
     Tyres = new Tyres(
         (TyreCompound)reader.ReadByte(),
         (TyreCompound)reader.ReadByte(),
         (TyreCompound)reader.ReadByte(),
         (TyreCompound)reader.ReadByte());
     Work = (PitWorkFlags)reader.ReadUInt32();
 }