Example #1
0
        public static SOPVehicle FromXml2(string text)
        {
            if (text == String.Empty)
            {
                return(null);
            }

            UTF8Encoding  enc     = new UTF8Encoding();
            MemoryStream  ms      = new MemoryStream(enc.GetBytes(text));
            XmlTextReader xreader = new XmlTextReader(ms);

            SOPVehicle v = new SOPVehicle();
            bool       error;

            v.FromXml2(xreader, out error);

            xreader.Close();

            if (error)
            {
                v = null;
                return(null);
            }
            return(v);
        }
Example #2
0
        public static SOPVehicle FromXml2(XmlReader reader)
        {
            SOPVehicle vehicle = new SOPVehicle();

            bool errors = false;

            vehicle.FromXml2(reader, out errors);
            if (errors)
            {
                return(null);
            }

            return(vehicle);
        }
Example #3
0
 public void SetVehicleType(int type)
 {
         m_vehicleParams = null;
         
         if (type == (int)Vehicle.TYPE_NONE)
         {
             if (_parentID ==0 && PhysActor != null)
                 PhysActor.VehicleType = (int)Vehicle.TYPE_NONE;
             return;
         }
         m_vehicleParams = new SOPVehicle();
         m_vehicleParams.ProcessTypeChange((Vehicle)type);
         {
             if (_parentID ==0 && PhysActor != null)
                 PhysActor.VehicleType = type;
             return;
         }
 }