Пример #1
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);
    }
Пример #2
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);
        }
    }