Esempio n. 1
0
 ///<summary>
 /// Writes this Boid.Position to the specified stream.
 ///</summary>
 ///<param name="writer"> the output stream to write to</param>
 ///<param name="Position"> the property to serialize</param>
 ///<exception cref="System.IO.IOException"> if an error occurs</exception>
 public override void Serialize(HlaEncodingWriter writer, object Position)
 {
     try
     {
         Vector3XrtiSerializer.Serialize(writer, (Vector3)Position);
     }
     catch (IOException ioe)
     {
         throw new RTIinternalError(ioe.ToString());
     }
 }
Esempio n. 2
0
        ///<summary>
        /// Reads and returns a Boid.Velocity from the specified stream.
        ///</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<param name="dummy"> this parameter is not used</param>
        ///<returns> the decoded value</returns>
        ///<exception cref="System.IO.IOException"> if an error occurs</exception>
        public override object Deserialize(HlaEncodingReader reader, ref object dummy)
        {
            Vector3 decodedValue;

            try
            {
                decodedValue = Vector3XrtiSerializer.Deserialize(reader);
                return(decodedValue);
            }
            catch (IOException ioe)
            {
                throw new FederateInternalError(ioe.ToString());
            }
        }