//! Reads/Writes struct properties from/to a stream
        public override void Serialize(PropertyStream stream)
        {
            base.Serialize(stream);

            stream.SerializeStruct("Src", m_Src);
            stream.SerializeStruct("Dest", m_Dest);
            m_fSpeed = stream.Serialize<float>("Speed");
        }
Example #2
0
        //! serializes the entity to/from a PropertyStream
        public override void Serialize(PropertyStream stream)
        {
            base.Serialize(stream);

            m_ChildEntityPath = stream.Serialize<string>("ChildEntityPath");

            if (m_ChildEntityPath.Length > 0)
            {
                m_ChildEntity = new Entity();
                m_ChildEntity.LoadFromXML(m_ChildEntityPath, null);
                m_ChildEntity.Init();
                AddChild(m_ChildEntity);
            }
        }
        //! serializes the entity to/from a PropertyStream
        public override void Serialize(PropertyStream stream)
        {
            base.Serialize(stream);

            m_strTemplatePath = stream.Serialize<string>("TemplatePath");

            if (m_strTemplatePath.Length > 0)
            {
                LoadFromXML(m_strTemplatePath, this);
            }

            // serialize the instance data
            if(GetNumChildren() > 0)
            {
                m_InstanceData.m_Instance = GetChild(0);
                stream.SerializeStruct("InstanceData", m_InstanceData);
            }
        }
        //! serializes the entity to/from a PropertyStream
        public override void Serialize(PropertyStream stream)
        {
            base.Serialize(stream);

            m_FOV = stream.Serialize<float>("FOV");
            m_ZNear = stream.Serialize<float>("ZNear");
            m_ZFar = stream.Serialize<float>("ZFar");
            m_eType = (E_Type)stream.Serialize<int>("Projection");
            m_vUpVector = stream.Serialize<Vector3>("UpVector");
        }
Example #5
0
        //! serializes the entity to/from a PropertyStream
        public override void Serialize(PropertyStream stream)
        {
            base.Serialize(stream);

            m_bEnabled = stream.Serialize<bool>("Enabled");
            m_bVisible = stream.Serialize<bool>("Visible");

            stream.SerializeReference("Visitor", m_VisitorRef);
        }
        //! serializes the entity to/from a PropertyStream
        public override void Serialize(PropertyStream stream)
        {
            base.Serialize(stream);

            m_vPosition = stream.Serialize<Vector2>("Position");
            m_fRotation = stream.Serialize<float>("Rotation");
            m_vScale = stream.Serialize<Vector2>("Scale");
            m_vCenter = stream.Serialize<Vector2>("Center");
            m_BoundingBox = stream.Serialize<BoundingBox>("BBox");
            m_bHFlip = stream.Serialize<bool>("HFlip");
            m_bVFlip = stream.Serialize<bool>("VFlip");
        }
        //! serializes the entity to/from a PropertyStream
        public override void Serialize(PropertyStream stream)
        {
            base.Serialize(stream);

            m_strPath = stream.Serialize<string>("Path");
        }
Example #8
0
 //! serializes the entity to/from a PropertyStream
 public virtual void Serialize(PropertyStream stream)
 {
     m_ID = stream.Serialize<uint>("ID");
     m_Name = stream.Serialize<string>("Name");
 }
        //! serializes the entity to/from a PropertyStream
        public override void Serialize(PropertyStream stream)
        {
            base.Serialize(stream);

            m_vPosition = stream.Serialize<Vector3>("Position");
            m_vRotation = stream.Serialize<Vector3>("Rotation");
            m_vScale = stream.Serialize<Vector3>("Scale");
            m_vCenter = stream.Serialize<Vector3>("Center");
            m_BoundingBox = stream.Serialize<BoundingBox>("BBox");
        }
Example #10
0
 //! Reads/Writes struct properties from/to a stream
 public override void Serialize(PropertyStream stream)
 {
     base.Serialize(stream);
     m_AutoStart = stream.Serialize<bool>("AutoStart");
 }
Example #11
0
        //! Reads/Writes struct properties from/to a stream
        public override void Serialize(PropertyStream stream)
        {
            base.Serialize(stream);

            bool bLighting = stream.Serialize<bool>("Lighting");
            SetFlag(E_Flag.MF_Lighting, bLighting);

            m_Color = stream.Serialize<Color>("Color");
            m_Color.A = (byte)(stream.Serialize<float>("Alpha")*255.0f);

            stream.SerializeArray<string>("Textures", m_strTextures);
            for(int i=0; i<m_strTextures.Count; ++i)
            {
                if(m_strTextures[i].Length > 0)
                {
                    // remove extension
                    string path = m_strTextures[i].Split('.')[0];
                    m_aTextures[i] = Engine.Instance().Content.Load<Texture2D>(path);
                }
                else
                {
                    m_aTextures[i] = null;
                }
            }
        }