Exemple #1
0
void StaticObject::Deserialize(TiXmlElement* root)
{
    World* world = World::GetPtr();
    TiXmlNode* node = NULL;
    TiXmlElement* cmeta = NULL;
    TiXmlElement* components = NULL;
    IComponentMeta* com = NULL;
    std::string cname;

    _short = root->Attribute("short");
    _plural = root->Attribute("plural");
    node = root->FirstChild("components");
    if (node)
        {
            components = node->ToElement();
            for (node = components->FirstChild(); node; node = node->NextSibling())
                {
                    cmeta = node->ToElement();
                    cname = cmeta->Attribute("name");
                    com = world->GetComponentFactory()->GetMeta(cname);
                    com->Deserialize(cmeta);
                }
        }
}