Ejemplo n.º 1
0
void
GameObject::Save( XMLPrinter & p )
{
  p.OpenElement("Item");
  p.PushAttribute("name", GetName().c_str());
  p.PushAttribute("id", GetId().c_str());
  p.PushAttribute("description", GetDescription().c_str());
  p.PushAttribute("match", GetNamePattern().str().c_str());
  SaveProperties(p);

  p.CloseElement();
}
Ejemplo n.º 2
0
Archivo: Player.cpp Proyecto: jjalo/SDL
void
Player::Save( XMLPrinter & p )
{
  p.OpenElement("Player");
  p.PushAttribute("name", GetName().c_str());
  p.PushAttribute("id", GetId().c_str());
  p.PushAttribute("description", GetDescription().c_str());
  p.OpenElement("Items");
  for(auto i : GetItems() ) i->Save(p);
  p.CloseElement();
  SaveProperties(p);
  p.CloseElement();
}
Ejemplo n.º 3
0
void
GameObject::SaveProperties( XMLPrinter & p )
{
  p.OpenElement("Properties");
  for(auto property : GetProperties())
  {
    p.OpenElement("Property");
    p.PushAttribute("id",property.second->GetId().c_str());
    p.PushAttribute("type", "string");
    string tmp = (*property.second).As<string>();
    p.PushAttribute("value", tmp.c_str());
    p.CloseElement();
  }
  p.CloseElement();
}