Example #1
0
        void GearConstraint::ProtoDeSerialize(const XML::Node& OneNode)
        {
            if ( Mezzanine::String(OneNode.Name())==this->GearConstraint::SerializableName() )
            {
                if(OneNode.GetAttribute("Version").AsInt() == 1)
                {
                    this->Constraint::ProtoDeSerialize(OneNode.GetChild("Constraint"));

                    this->SetRotationRatio(OneNode.GetAttribute("Ratio").AsReal());

                    XML::Node ActorANode = OneNode.GetChild("ActorA");
                    if(!ActorANode)
                        { DeSerializeError("Could not find ActorA axis",SerializableName()); }

                    XML::Node ActorBNode = OneNode.GetChild("ActorB");
                    if(!ActorBNode)
                        { DeSerializeError("Could not find ActorB axis",SerializableName()); }

                    Vector3 temp;
                    temp.ProtoDeSerialize(ActorANode.GetFirstChild());
                    this->SetAxisA(temp);
                    temp.ProtoDeSerialize(ActorBNode.GetFirstChild());
                    this->SetAxisB(temp);
                }else{
                    DeSerializeError("find usable serialization version",SerializableName());
                }
            }else{
                DeSerializeError(String("find correct class to deserialize, found a ")+OneNode.Name(),SerializableName());
            }
        }
		void Configuration::Node::Load(Xml::Node xmlNode)
		{
			do
			{
				Map::iterator it(map.insert( Map::value_type(xmlNode.GetType(),Node()) ));

				it->second.parent.map = ↦
				it->second.parent.item = it;

				if (const Xml::Node xmlChild=xmlNode.GetFirstChild())
					it->second.Load( xmlChild );
				else
					it->second.string = xmlNode.GetValue();

				xmlNode = xmlNode.GetNextSibling();
			}
			while (xmlNode);
		}