示例#1
0
 /// <summary>
 /// Receives the specified reader.
 /// </summary>
 /// <param name="reader">The reader.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnReceive(BigEndianStream reader, int version)
 {
     if (reader == null)
         throw new System.ArgumentNullException("reader");
     PositionX = reader.ReadDouble();
     PositionY = reader.ReadDouble();
     PositionZ = reader.ReadDouble();
     Radius = reader.ReadSingle();
     var records = new ExplosionRecord[RecordCount = reader.ReadInt32()];
     for (int i = 0; i < RecordCount; i++)
     {
         var record = new ExplosionRecord();
         record.OffsetX = reader.ReadByte();
         record.OffsetY = reader.ReadByte();
         record.OffsetZ = reader.ReadByte();
         records[i] = record;
     }
     Records = records;
     if (version >= 36)
     {
         VelocityX = reader.ReadSingle();
         VelocityY = reader.ReadSingle();
         VelocityZ = reader.ReadSingle();
     }
 }
示例#2
0
        /// <summary>
        ///   Initializes a new instance of the <see cref="Explosion" /> class.
        /// </summary>
        /// <remarks>
        /// </remarks>
        public Explosion()
        {
            Code = 0x3C;

            Records = new ExplosionRecord[0];
        }