Esempio n. 1
0
        /// <summary>
        /// Gets the packet.
        /// </summary>
        /// <param name="packetLocation">The packet location.</param>
        /// <returns>Instance of found packet, <c>null</c> otherwise.</returns>
        public Packet GetPacket(PacketLocation packetLocation)
        {
            Packet ret = null;

            if (packetLocation.LogIndex >= 0 && m_logs.Count > packetLocation.LogIndex)
            {
                PacketLog log = m_logs[packetLocation.LogIndex];
                if (packetLocation.PacketIndex >= 0 && log.Count > packetLocation.PacketIndex)
                {
                    ret = log[packetLocation.PacketIndex];
                }
            }

            return(ret);
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:PacketInfo"/> class.
 /// </summary>
 /// <param name="newPacket">The new packet.</param>
 /// <param name="newTextIndex">New index of the text.</param>
 /// <param name="newPacketLocation">New packet location.</param>
 public PacketInfo(Packet newPacket, int newTextIndex, PacketLocation newPacketLocation)
 {
     Packet         = newPacket;
     TextEndIndex   = newTextIndex;
     PacketLocation = newPacketLocation;
 }