Esempio n. 1
0
        void GearConstraint::ProtoSerialize(XML::Node& CurrentRoot) const
        {
            XML::Node P2PNode = CurrentRoot.AppendChild(this->GearConstraint::SerializableName());                     // The base node all the base constraint stuff will go in
            if (!P2PNode)
                { SerializeError("Create P2PNode", SerializableName()); }

            XML::Attribute VerAttr = P2PNode.AppendAttribute("Version");
            XML::Attribute RatioAttr = P2PNode.AppendAttribute("Ratio");

            if( VerAttr && RatioAttr )
            {
                VerAttr.SetValue(1);
                RatioAttr.SetValue(this->GetRotationRatio());
            }else{
                SerializeError("Create P2PNode Attributes", SerializableName());
            }

            XML::Node ActorANode = P2PNode.AppendChild("ActorA");
            if (!ActorANode)
                { SerializeError("Create ActorANode", SerializableName()); }
            this->GetAxisA().ProtoSerialize(ActorANode);

            XML::Node ActorBNode = P2PNode.AppendChild("ActorB");
            if (!ActorBNode)
                { SerializeError("Create ActorBNode", SerializableName()); }
            this->GetAxisB().ProtoSerialize(ActorBNode);

            this->Constraint::ProtoSerialize(P2PNode);
        }
Esempio n. 2
0
        void CapsuleCollisionShape::ProtoSerialize(XML::Node& CurrentRoot) const
        {
            XML::Node CollisionNode = CurrentRoot.AppendChild(this->CapsuleCollisionShape::SerializableName());
            if (!CollisionNode) { SerializeError("create CollisionNode",this->CapsuleCollisionShape::SerializableName());}

            XML::Attribute Version = CollisionNode.AppendAttribute("Version");
            if (Version)
                { Version.SetValue(1); }
            else
                { SerializeError("Create Version Attribute", SerializableName()); }
/*
            XML::Attribute RadiusAttr = CollisionNode.AppendAttribute("Radius");
            if (RadiusAttr)
                { RadiusAttr.SetValue(this->GetCleanRadius()); }
            else
                { SerializeError("Create RadiusAttr Attribute", SerializableName()); }

            XML::Attribute HeightAttr = CollisionNode.AppendAttribute("Height");
            if (HeightAttr)
                { HeightAttr.SetValue(this->GetCleanHeight()); }
            else
                { SerializeError("Create HeightAttr Attribute", SerializableName()); }
*/
            XML::Attribute AxisAttr = CollisionNode.AppendAttribute("Axis");
            if (AxisAttr)
                { AxisAttr.SetValue(this->GetUpStandardAxis()); }
            else
                { SerializeError("Create AxisAttr Attribute", SerializableName()); }

            this->PrimitiveCollisionShape::ProtoSerialize(CollisionNode);
        }
Esempio n. 3
0
        void MeshCollisionShape::ProtoSerialize(XML::Node& CurrentRoot) const
        {
            XML::Node CollisionNode = CurrentRoot.AppendChild(this->MeshCollisionShape::GetSerializableName());
            if (!CollisionNode) { SerializeError("create CollisionNode",this->MeshCollisionShape::GetSerializableName());}

            XML::Attribute Version = CollisionNode.AppendAttribute("Version");
            if (Version)
                { Version.SetValue(1); }
            else
                { SerializeError("Create Version Attribute", GetSerializableName()); }

            this->CollisionShape::ProtoSerialize(CollisionNode);

        }
Esempio n. 4
0
    void Transform::ProtoSerialize(XML::Node& CurrentRoot) const
    {
        XML::Node TransformNode = CurrentRoot.AppendChild(SerializableName());                     // The base node all the base constraint stuff will go in
        if (!TransformNode)
            { SerializeError("Create TransformNode", SerializableName()); }

        Mezzanine::XML::Attribute Version = TransformNode.AppendAttribute("Version");                            // Version
        if (!Version)
            { SerializeError("Create Version", SerializableName()); }
        Version.SetValue(1);

        this->Location.ProtoSerialize(TransformNode);
        this->Rotation.ProtoSerialize(TransformNode);
    }
Esempio n. 5
0
    void ActorRigid::ProtoSerialize(XML::Node& CurrentRoot) const
    {
        XML::Node ActorNode = CurrentRoot.AppendChild("ActorRigid");
        if (!ActorNode) { ThrowSerialError("create ActorRigidNode");}

        XML::Attribute Version = ActorNode.AppendAttribute("Version");
        if (Version)
            { Version.SetValue(1); }
        else
            { SerializeError("Create set Version on ActorRigid node", SerializableName()); }

        XML::Attribute ActorName = ActorNode.AppendAttribute("Name");
            ActorName.SetValue(this->GetName());
        XML::Attribute ActorFile = ActorNode.AppendAttribute("File");
            ActorFile.SetValue(this->GraphicsObject->getMesh()->getName());
        XML::Attribute ActorGroup = ActorNode.AppendAttribute("Group");
            ActorGroup.SetValue(this->GraphicsObject->getMesh()->getGroup());
        if( !(ActorName && ActorFile && ActorGroup) )
            { ThrowSerialError("creating ActorRigid Attributes");}

        XML::Node LinearMovementFactor = ActorNode.AppendChild("LinearMovementFactor");
        if (!LinearMovementFactor) { ThrowSerialError("create LinearMovementFactor Node"); }
        this->GetLinearMovementFactor().ProtoSerialize(LinearMovementFactor);

        XML::Node AngularMovementFactor = ActorNode.AppendChild("AngularMovementFactor");
        if (!AngularMovementFactor) { ThrowSerialError("create AngularMovementFactor Node"); }
        this->GetAngularMovementFactor().ProtoSerialize(AngularMovementFactor);

        ActorBase::ProtoSerialize(ActorNode);
    }
Esempio n. 6
0
        void SliderConstraint::ProtoSerializeProperties(XML::Node& SelfRoot) const
        {
            this->Constraint::ProtoSerializeProperties(SelfRoot);

            XML::Node PropertiesNode = SelfRoot.AppendChild( SliderConstraint::GetSerializableName() + "Properties" );

            if( PropertiesNode.AppendAttribute("Version").SetValue("1") &&
                PropertiesNode.AppendAttribute("UseFrameOffset").SetValue( this->GetUseFrameOffset() ) &&
                PropertiesNode.AppendAttribute("UpperLinLimit").SetValue( this->GetUpperLinLimit() ) &&
                PropertiesNode.AppendAttribute("UpperAngLimit").SetValue( this->GetUpperAngLimit() ) &&
                PropertiesNode.AppendAttribute("LowerLinLimit").SetValue( this->GetLowerLinLimit() ) &&
                PropertiesNode.AppendAttribute("LowerAngLimit").SetValue( this->GetLowerAngLimit() ) &&
                PropertiesNode.AppendAttribute("PoweredLinMotor").SetValue( this->GetPoweredLinMotor() ) &&
                PropertiesNode.AppendAttribute("PoweredAngMotor").SetValue( this->GetPoweredAngMotor() ) &&
                PropertiesNode.AppendAttribute("TargetLinMotorVelocity").SetValue( this->GetTargetLinMotorVelocity() ) &&
                PropertiesNode.AppendAttribute("TargetAngMotorVelocity").SetValue( this->GetTargetAngMotorVelocity() ) &&
                PropertiesNode.AppendAttribute("MaxLinMotorForce").SetValue( this->GetMaxLinMotorForce() ) &&
                PropertiesNode.AppendAttribute("MaxAngMotorForce").SetValue( this->GetMaxAngMotorForce() ) &&
                PropertiesNode.AppendAttribute("SoftnessLimLin").SetValue( this->GetSoftnessLimLin() ) &&
                PropertiesNode.AppendAttribute("SoftnessLimAng").SetValue( this->GetSoftnessLimAng() ) &&
                PropertiesNode.AppendAttribute("SoftnessOrthoLin").SetValue( this->GetSoftnessOrthoLin() ) &&
                PropertiesNode.AppendAttribute("SoftnessOrthoAng").SetValue( this->GetSoftnessOrthoAng() ) )
            {
                return;
            }else{
                SerializeError("Create XML Attribute Values",SliderConstraint::GetSerializableName() + "Properties",true);
            }
        }
Esempio n. 7
0
        void MultiImageLayer::ProtoSerializeProperties(XML::Node& SelfRoot) const
        {
            this->ImageLayer::ProtoSerializeProperties(SelfRoot);
            XML::Node PropertiesNode = SelfRoot.AppendChild( MultiImageLayer::GetSerializableName() + "Properties" );

            if( PropertiesNode.AppendAttribute("Version").SetValue("1") )
            {
                XML::Node LayerImagesNode = PropertiesNode.AppendChild( "LayerImages" );
                LayerImagesNode.AppendAttribute("NumImages").SetValue( this->LayerImages.size() );

                for( ConstImageDataIterator ImageIt = this->LayerImages.begin() ; ImageIt != this->LayerImages.end() ; ++ImageIt )
                {
                    XML::Node ImageDataRoot = LayerImagesNode.AppendChild( "MultiImageData" );

                    if( ImageDataRoot.AppendAttribute("Version").SetValue("1") &&
                        ImageDataRoot.AppendAttribute("SpriteName").SetValue( (*ImageIt).LayerSprite ? (*ImageIt).LayerSprite->Name : "" ) &&
                        ImageDataRoot.AppendAttribute("SpriteAtlas").SetValue( (*ImageIt).LayerSprite ? (*ImageIt).LayerSprite->GetAtlasName() : "" ) )
                    {
                        XML::Node FillRectNode = ImageDataRoot.AppendChild("FillRect");
                        (*ImageIt).FillRect.ProtoSerialize( FillRectNode );

                        XML::Node FillColoursNode = ImageDataRoot.AppendChild("FillColours");
                        XML::Node TopLeftFillNode = FillColoursNode.AppendChild("TopLeft");
                        (*ImageIt).FillColours[UI::QC_TopLeft].ProtoSerialize(TopLeftFillNode);

                        XML::Node TopRightFillNode = FillColoursNode.AppendChild("TopRight");
                        (*ImageIt).FillColours[UI::QC_TopRight].ProtoSerialize(TopRightFillNode);

                        XML::Node BottomLeftFillNode = FillColoursNode.AppendChild("BottomLeft");
                        (*ImageIt).FillColours[UI::QC_BottomLeft].ProtoSerialize(BottomLeftFillNode);

                        XML::Node BottomRightFillNode = FillColoursNode.AppendChild("BottomRight");
                        (*ImageIt).FillColours[UI::QC_BottomRight].ProtoSerialize(BottomRightFillNode);

                        return;
                    }else{
                        SerializeError("Create XML Attribute Values","MultiImageData",true);
                    }
                }

                return;
            }else{
                SerializeError("Create XML Attribute Values",MultiImageLayer::GetSerializableName() + "Properties",true);
            }
        }
Esempio n. 8
0
    void WorldProxy::ProtoSerialize(XML::Node& ParentNode) const
    {
        XML::Node SelfRoot = ParentNode.AppendChild(this->GetDerivedSerializableName());
        if( !SelfRoot.AppendAttribute("InWorld").SetValue( this->IsInWorld() ? "true" : "false" ) ) {
            SerializeError("Create XML Attribute Values",WorldProxy::GetSerializableName(),true);
        }

        this->ProtoSerializeImpl(SelfRoot);
    }
Esempio n. 9
0
        void Widget::ProtoSerializeEvents(XML::Node& SelfRoot) const
        {
            XML::Node EventsNode = SelfRoot.AppendChild( "Events" );

            if( EventsNode.AppendAttribute("Version").SetValue("1") ) {
                for( ConstEventIterator EvIt = this->Events.begin() ; EvIt != this->Events.end() ; ++EvIt )
                {
                    XML::Node BindingNode = EventsNode.AppendChild( "Event" );

                    if( BindingNode.AppendAttribute("Version").SetValue("1") &&
                        BindingNode.AppendAttribute("Name").SetValue( (*EvIt).first ) )
                    {
                        continue;
                    }else{
                        SerializeError("Create XML Version Attribute","Event",true);
                    }
                }
            }else{
                SerializeError("Create XML Version Attribute","Events",true);
            }
        }
Esempio n. 10
0
        void SimpleRenderer::ProtoSerializeProperties(XML::Node& SelfRoot) const
        {
            XML::Node PropertiesNode = SelfRoot.AppendChild( SimpleRenderer::GetSerializableName() + "Properties" );

            if( PropertiesNode.AppendAttribute("Version").SetValue("1") &&
                PropertiesNode.AppendAttribute("PriAtlas").SetValue(this->PriAtlas) )
            {
                return;
            }else{
                SerializeError("Create XML Attribute Values",SimpleRenderer::GetSerializableName() + "Properties",true);
            }
        }
Esempio n. 11
0
        void Widget::ProtoSerializeProperties(XML::Node& SelfRoot) const
        {
            this->QuadRenderable::ProtoSerializeProperties(SelfRoot);
            XML::Node PropertiesNode = SelfRoot.AppendChild( Widget::GetSerializableName() + "Properties" );

            if( PropertiesNode.AppendAttribute("Version").SetValue("1") &&
                PropertiesNode.AppendAttribute("State").SetValue( this->State ) )
            {
                return;
            }else{
                SerializeError("Create XML Attribute Values",Widget::GetSerializableName() + "Properties",true);
            }
        }
Esempio n. 12
0
        void ParticleAffector::ProtoSerializeCustomParameters(XML::Node& SelfRoot) const
        {
            XML::Node CustomParametersNode = SelfRoot.AppendChild( "CustomParameters" );

            if( CustomParametersNode.AppendAttribute("Version").SetValue("1") )
            {
                for( NameValuePairMap::const_iterator ParamIt = this->CustomAffectorParameters.begin() ; ParamIt != this->CustomAffectorParameters.end() ; ++ParamIt )
                {
                    XML::Node CustomParamNode = CustomParametersNode.AppendChild( "CustomParam" );
                    if( CustomParamNode.AppendAttribute("Version").SetValue("1") &&
                        CustomParamNode.AppendAttribute("ParamName").SetValue( (*ParamIt).first ) &&
                        CustomParamNode.AppendAttribute("ParamValue").SetValue( (*ParamIt).second ) )
                    {
                        return;
                    }else{
                        SerializeError("Create XML Attribute Values",ParticleAffector::GetSerializableName() + "CustomParameters",true);
                    }
                }
            }else{
                SerializeError("Create XML Attribute Values",ParticleAffector::GetSerializableName() + "CustomParameters",true);
            }
        }
Esempio n. 13
0
        void TabSet::ProtoSerializeButtonBindings(XML::Node& SelfRoot) const
        {
            XML::Node BindingsNode = SelfRoot.AppendChild( "SubSetBindings" );

            if( BindingsNode.AppendAttribute("Version").SetValue("1") ) {
                for( ConstTabbedSubSetIterator BindingIt = this->SubSetBindings.begin() ; BindingIt != this->SubSetBindings.end() ; ++BindingIt )
                {
                    XML::Node BindingNode = BindingsNode.AppendChild( "SubSetBinding" );

                    if( BindingNode.AppendAttribute("Version").SetValue("1") &&
                        BindingNode.AppendAttribute("ConfigID").SetValue( (*BindingIt).second ) &&
                        BindingNode.AppendAttribute("ButtonName").SetValue( (*BindingIt).first->GetName() ) )
                    {
                        continue;
                    }else{
                        SerializeError("Create XML Version Attribute","SubSetBinding",true);
                    }
                }
            }else{
                SerializeError("Create XML Version Attribute","SubSetBindings",true);
            }
        }
Esempio n. 14
0
        void Widget::ProtoSerializeStateGroupBindings(XML::Node& SelfRoot) const
        {
            XML::Node BindingsNode = SelfRoot.AppendChild( "StateGroupBindings" );

            if( BindingsNode.AppendAttribute("Version").SetValue("1") ) {
                for( ConstStateLayerGroupIterator BindingIt = this->StateGroupBindings.begin() ; BindingIt != this->StateGroupBindings.end() ; ++BindingIt )
                {
                    XML::Node BindingNode = BindingsNode.AppendChild( "StateGroupBinding" );

                    if( BindingNode.AppendAttribute("Version").SetValue("1") &&
                        BindingNode.AppendAttribute("StateID").SetValue( (*BindingIt).first ) &&
                        BindingNode.AppendAttribute("LayerGroupID").SetValue( (*BindingIt).second->GetGroupID() ) )
                    {
                        continue;
                    }else{
                        SerializeError("Create XML Version Attribute","StateGroupBinding",true);
                    }
                }
            }else{
                SerializeError("Create XML Version Attribute","StateGroupBindings",true);
            }
        }
Esempio n. 15
0
    void ColourValue::ProtoSerialize(XML::Node& CurrentRoot) const
    {
        Mezzanine::XML::Node VecNode = CurrentRoot.AppendChild(this->ColourValue::GetSerializableName());
        VecNode.SetName(this->ColourValue::GetSerializableName());

        Mezzanine::XML::Attribute VersionAttr = VecNode.AppendAttribute("Version");
        Mezzanine::XML::Attribute RAttr = VecNode.AppendAttribute("Red");
        Mezzanine::XML::Attribute GAttr = VecNode.AppendAttribute("Green");
        Mezzanine::XML::Attribute BAttr = VecNode.AppendAttribute("Blue");
        Mezzanine::XML::Attribute AAttr = VecNode.AppendAttribute("Alpha");
        if( VersionAttr && RAttr && BAttr && GAttr && AAttr)
        {
            if( VersionAttr.SetValue("1") && RAttr.SetValue(this->RedChannel) && BAttr.SetValue(this->BlueChannel) && GAttr.SetValue(this->GreenChannel) && AAttr.SetValue(this->AlphaChannel))
            {
                return;
            }else{
                SerializeError("Create XML Attribute Values", this->ColourValue::GetSerializableName(),true);
            }
        }else{
            SerializeError("Create XML Attributes", this->ColourValue::GetSerializableName(),true);
        }
    }
Esempio n. 16
0
        void RadioButton::ProtoSerializeGroupButtons(XML::Node& SelfRoot) const
        {
            XML::Node ButtonsNode = SelfRoot.AppendChild( "GroupButtons" );

            if( ButtonsNode.AppendAttribute("Version").SetValue("1") ) {
                RadioButtonGroup::ConstRadioButtonIterator ButBeg = this->ButtonGroup->RadioButtonBegin();
                RadioButtonGroup::ConstRadioButtonIterator ButEnd = this->ButtonGroup->RadioButtonEnd();
                for( RadioButtonGroup::ConstRadioButtonIterator ButIt = ButBeg ; ButIt != ButEnd ; ++ButIt )
                {
                    XML::Node ButtonNode = ButtonsNode.AppendChild( "GroupButton" );

                    if( ButtonNode.AppendAttribute("Version").SetValue("1") &&
                        ButtonNode.AppendAttribute("GroupButtonName").SetValue( (*ButIt)->GetName() ) )
                    {
                        continue;
                    }else{
                        SerializeError("Create XML Version Attribute","GroupButton",true);
                    }
                }
            }else{
                SerializeError("Create XML Version Attribute","GroupButtons",true);
            }
        }
Esempio n. 17
0
void LevelZone::ProtoSerializeProperties(XML::Node& SelfRoot) const
{
    this->AreaEffect::ProtoSerializeProperties(SelfRoot);
    XML::Node PropertiesNode = SelfRoot.AppendChild( LevelZone::GetSerializableName() + "Properties" );

    if( PropertiesNode.AppendAttribute("Version").SetValue("1") )
    {
        XML::Node ZoneSizeNode = PropertiesNode.AppendChild("ZoneSize");
        this->ZoneSize.ProtoSerialize( ZoneSizeNode );

        return;
    }else{
        SerializeError("Create XML Attribute Values",LevelZone::GetSerializableName() + "Properties",true);
    }
}
Esempio n. 18
0
    void GravityWell::ProtoSerializeProperties(XML::Node& SelfRoot) const
    {
        this->AreaEffect::ProtoSerializeProperties(SelfRoot);

        XML::Node PropertiesNode = SelfRoot.AppendChild( GravityWell::GetSerializableName() + "Properties" );

        if( PropertiesNode.AppendAttribute("Version").SetValue("1") &&
            PropertiesNode.AppendAttribute("AttenAmount").SetValue( this->GetAttenuationAmount() ) &&
            PropertiesNode.AppendAttribute("AttenStyle").SetValue( this->GetAttenuationStyle() ) &&
            PropertiesNode.AppendAttribute("Strength").SetValue( this->GetFieldStrength() ) &&
            PropertiesNode.AppendAttribute("AllowWorldGravity").SetValue( this->GetAllowWorldGravity() ? "true" : "false" ) )
        {
            return;
        }else{
            SerializeError("Create XML Attribute Values",GravityWell::GetSerializableName() + "Properties",true);
        }
    }
Esempio n. 19
0
    void WorldProxy::ProtoSerializeProperties(XML::Node& SelfRoot) const
    {
        XML::Node PropertiesNode = SelfRoot.AppendChild( WorldProxy::GetSerializableName() + "Properties" );

        if( PropertiesNode.AppendAttribute("Version").SetValue("1") &&
            PropertiesNode.AppendAttribute("ProxyID").SetValue(this->ProxyID) )
        {
            XML::Node LocationNode = PropertiesNode.AppendChild("Location");
            this->GetLocation().ProtoSerialize( LocationNode );
            XML::Node OrientationNode = PropertiesNode.AppendChild("Orientation");
            this->GetOrientation().ProtoSerialize( OrientationNode );
            XML::Node ScaleNode = PropertiesNode.AppendChild("Scale");
            this->GetScale().ProtoSerialize( ScaleNode );

            return;
        }else{
            SerializeError("Create XML Attribute Values",WorldProxy::GetSerializableName() + "Properties",true);
        }
    }
Esempio n. 20
0
 void NonStaticWorldObject::ThrowSerialError(const String& Fail) const
     { SerializeError(Fail, SerializableName()); }
Esempio n. 21
0
 void AreaEffect::ThrowSerialError(const String& Fail) const
     { SerializeError(Fail, SerializableName()); }
Esempio n. 22
0
///////////////////////////////////////////////////////////////////////////////
// Serialization
///////////////////////////////////////
    void ActorRigid::ThrowSerialError(const String& Fail) const
        { SerializeError(Fail, SerializableName()); }