Exemple #1
0
        /// <summary>
        /// Encode data for network transmission.
        /// </summary>
        /// <param name="bw"></param>
        public override void Encode(BinaryWriter bw)
        {
            base.Encode(bw);   // Header
            bw.Write(velocity.x);
            bw.Write(velocity.y);
            bw.Write(velocity.z);
            locationInWorldCoordinates.Encode(bw);

            // Default descriptor
            if (descriptor == null)
            {
                descriptor = new MunitionDescriptor();
            }

            descriptor.Encode(bw);

            bw.Write(locationInEntityCoordinates.x);
            bw.Write(locationInEntityCoordinates.y);
            bw.Write(locationInEntityCoordinates.z);
            bw.Write(( byte )detonationResult);

            bw.Write(( byte )variableParameters.NumberOfRecords);

            bw.Write(( ushort )0);   // Padding
            variableParameters.Encode(bw);
        }
Exemple #2
0
        /// <summary>
        /// Encode data for network transmission.
        /// </summary>
        /// <param name="bw"></param>
        public override void Encode(BinaryWriter bw)
        {
            base.Encode(bw);   // Header
            bw.Write(fireMissionIndex);
            locationInWorldCoordinates.Encode(bw);

            // Default descriptor
            if (descriptor == null)
            {
                descriptor = new MunitionDescriptor();
            }
            descriptor.Encode(bw);

            bw.Write(velocity.x);
            bw.Write(velocity.y);
            bw.Write(velocity.z);
            bw.Write(range);
        }
 /// <summary>
 /// Encode data for network transmission.
 /// </summary>
 /// <param name="bw"></param>
 public override void Encode(BinaryWriter bw)
 {
     base.Encode(bw);   // Header
     entityID.Encode(bw);
     bw.Write(( byte )forceID);
     bw.Write(( byte )variableParameters.NumberOfRecords);
     entityType.Encode(bw);
     alternateEntityType.Encode(bw);
     bw.Write(linearVelocity.x);
     bw.Write(linearVelocity.y);
     bw.Write(linearVelocity.z);
     location.Encode(bw);
     bw.Write(orientation.x);
     bw.Write(orientation.y);
     bw.Write(orientation.z);
     appearance.Encode(bw);
     deadReckoningParameter.Encode(bw);
     marking.Encode(bw);
     capabilities.Encode(bw);
     variableParameters.Encode(bw);
 }