Пример #1
0
void loadGroup(XMLNodePtr node)
{
   XMLNodeList children = node->getChildren();
   for (XMLNodeList::iterator itr = children.begin();
        itr != children.end();
        ++itr)
   {
      XMLNodePtr node = *itr;
      if (node->getName() == "static" || node->getName() == "turret" || node->getName() == "security_droid" || node->getName() == "navNode" )
      {
         loadStatic(node);
      }
   }
}
Пример #2
0
void processObjNode(XMLNode &node)
{
   model* mModel = new model();
   std::string name = node.getName();
      
   std::cout << "This Node is a: " << name << std::endl;


   
   XMLNodePtr cNode = node.getChild(std::string("size"));
   std::cout << "node: " << cNode->getName() << std::endl;
   mModel->xhi = cNode->getAttribute("xhi").getValue<float>();
   mModel->xlo = cNode->getAttribute("xlo").getValue<float>();
   mModel->yhi = cNode->getAttribute("yhi").getValue<float>();
   mModel->ylo = cNode->getAttribute("ylo").getValue<float>();
   std::cout << "mModel.xlo: " << mModel->xlo << "  mModel.ylo: " << mModel->b << std::endl;
   std::cout << "type: " << cNode->getType() << std::endl;
   cNode = node.getChild(std::string("color"));
   mModel->r = cNode->getAttribute(std::string("r")).getValue<float>();
   mModel->g = cNode->getAttribute(std::string("g")).getValue<float>();
   mModel->b = cNode->getAttribute(std::string("b")).getValue<float>();
   cNode = node.getChild(std::string("type"));
   mModel->name = cNode->getAttribute(std::string("name")).getValue<std::string>();
   modelsInMenu.push_back(*mModel);
}