当前位置: 首页>>代码示例>>C++>>正文


C++ SerializerElement::AddChild方法代码示例

本文整理汇总了C++中SerializerElement::AddChild方法的典型用法代码示例。如果您正苦于以下问题:C++ SerializerElement::AddChild方法的具体用法?C++ SerializerElement::AddChild怎么用?C++ SerializerElement::AddChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SerializerElement的用法示例。


在下文中一共展示了SerializerElement::AddChild方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SerializeTo

void Layer::SerializeTo(SerializerElement& element) const {
  element.SetAttribute("name", GetName());
  element.SetAttribute("visibility", GetVisibility());

  SerializerElement& camerasElement = element.AddChild("cameras");
  camerasElement.ConsiderAsArrayOf("camera");
  for (std::size_t c = 0; c < GetCameraCount(); ++c) {
    SerializerElement& cameraElement = camerasElement.AddChild("camera");
    cameraElement.SetAttribute("defaultSize", GetCamera(c).UseDefaultSize());
    cameraElement.SetAttribute("width", GetCamera(c).GetWidth());
    cameraElement.SetAttribute("height", GetCamera(c).GetHeight());

    cameraElement.SetAttribute("defaultViewport",
                               GetCamera(c).UseDefaultViewport());
    cameraElement.SetAttribute("viewportLeft", GetCamera(c).GetViewportX1());
    cameraElement.SetAttribute("viewportTop", GetCamera(c).GetViewportY1());
    cameraElement.SetAttribute("viewportRight", GetCamera(c).GetViewportX2());
    cameraElement.SetAttribute("viewportBottom", GetCamera(c).GetViewportY2());
  }

  SerializerElement& effectsElement = element.AddChild("effects");
  effectsElement.ConsiderAsArrayOf("effect");
  for (std::size_t i = 0; i < GetEffectsCount(); ++i) {
    SerializerElement& effectElement = effectsElement.AddChild("effect");
    GetEffect(i).SerializeTo(effectElement);
  }
}
开发者ID:4ian,项目名称:GD,代码行数:27,代码来源:Layer.cpp

示例2: SerializeTo

void RepeatEvent::SerializeTo(SerializerElement & element) const
{
    element.AddChild("repeatExpression").SetValue(repeatNumberExpression.GetPlainString());
    gd::EventsListSerialization::SaveConditions(conditions, element.AddChild("conditions"));
    gd::EventsListSerialization::SaveActions(actions, element.AddChild("actions"));
    gd::EventsListSerialization::SerializeEventsTo(events, element.AddChild("events"));
}
开发者ID:heyuqi,项目名称:GD,代码行数:7,代码来源:RepeatEvent.cpp

示例3: SerializeTo

void ForEachEvent::SerializeTo(SerializerElement & element) const
{
    element.AddChild("object").SetValue(objectsToPick.GetPlainString());
    gd::EventsListSerialization::SaveConditions(conditions, element.AddChild("conditions"));
    gd::EventsListSerialization::SaveActions(actions, element.AddChild("actions"));
    gd::EventsListSerialization::SerializeEventsTo(events, element.AddChild("events"));
}
开发者ID:bran921007,项目名称:GD,代码行数:7,代码来源:ForEachEvent.cpp

示例4: SerializeTo

void WhileEvent::SerializeTo(SerializerElement & element) const
{
    element.SetAttribute("infiniteLoopWarning", infiniteLoopWarning);
    gd::EventsListSerialization::SaveConditions(whileConditions, element.AddChild("whileConditions"));
    gd::EventsListSerialization::SaveConditions(conditions, element.AddChild("conditions"));
    gd::EventsListSerialization::SaveActions(actions, element.AddChild("actions"));
    gd::EventsListSerialization::SerializeEventsTo(events, element.AddChild("events"));
}
开发者ID:victorlevasseur,项目名称:GD,代码行数:8,代码来源:WhileEvent.cpp

示例5: SerializeTo

void LinkEvent::SerializeTo(SerializerElement & element) const
{
    element.AddChild("include")
        .SetAttribute("includeAll", IncludeAllEvents())
        .SetAttribute("start", (int)GetIncludeStart())
        .SetAttribute("end", (int)GetIncludeEnd());

    element.AddChild("target").SetValue(GetTarget());
}
开发者ID:alcemirfernandes,项目名称:GD,代码行数:9,代码来源:LinkEvent.cpp

示例6: SerializeTo

void ExternalLayout::SerializeTo(SerializerElement & element) const
{
	element.SetAttribute("name", name);
	instances.SerializeTo(element.AddChild("instances"));
	#if !defined(GD_NO_WX_GUI)
	editionSettings.SerializeTo(element.AddChild("editionSettings"));
	element.SetAttribute("associatedLayout", associatedLayout);
	#endif
}
开发者ID:HaoDrang,项目名称:GD,代码行数:9,代码来源:ExternalLayout.cpp

示例7: SerializeTo

void CommentEvent::SerializeTo(SerializerElement & element) const
{
    element.AddChild("color")
        .SetAttribute("r", r)
        .SetAttribute("g", v)
        .SetAttribute("b", b)
        .SetAttribute("textR", textR)
        .SetAttribute("textG", textG)
        .SetAttribute("textB", textB);

    element.AddChild("comment").SetValue(com1);
    element.AddChild("comment2").SetValue(com2);
}
开发者ID:alcemirfernandes,项目名称:GD,代码行数:13,代码来源:CommentEvent.cpp

示例8: SerializeTo

void GroupEvent::SerializeTo(SerializerElement & element) const
{
    element.SetAttribute("name", name);
    element.SetAttribute("source", source);
    element.SetAttribute("creationTime", (int)creationTime);
    element.SetAttribute("colorR", (int)colorR);
    element.SetAttribute("colorG", (int)colorG);
    element.SetAttribute("colorB", (int)colorB);
    gd::EventsListSerialization::SerializeEventsTo(events, element.AddChild("events"));

    gd::SerializerElement & parametersElement = element.AddChild("parameters");
    parametersElement.ConsiderAsArrayOf("parameter");
    for ( std::size_t i = 0;i < parameters.size();++i)
        parametersElement.AddChild("parameter").SetValue(parameters[i]);
}
开发者ID:alcemirfernandes,项目名称:GD,代码行数:15,代码来源:GroupEvent.cpp

示例9: SerializeTo

void ExternalEvents::SerializeTo(SerializerElement & element) const
{
    element.SetAttribute("name", name);
    element.SetAttribute("associatedLayout", associatedScene);
    element.SetAttribute("lastChangeTimeStamp", (int)lastChangeTimeStamp);
    gd::EventsListSerialization::SerializeEventsTo(events, element.AddChild("events"));
}
开发者ID:HaoDrang,项目名称:GD,代码行数:7,代码来源:ExternalEvents.cpp

示例10: SerializeTo

void LinkEvent::SerializeTo(SerializerElement & element) const
{
    SerializerElement & includeElement = element.AddChild("include")
        .SetAttribute("includeConfig", static_cast<int>(GetIncludeConfig()));

    if(GetIncludeConfig() == INCLUDE_EVENTS_GROUP)
    {
        includeElement.SetAttribute("eventsGroup", GetEventsGroupName());
    }
    else if(GetIncludeConfig() == INCLUDE_BY_INDEX)
    {
        includeElement.SetAttribute("start", static_cast<int>(GetIncludeStart()));
        includeElement.SetAttribute("end", static_cast<int>(GetIncludeEnd()));
    }

    element.AddChild("target").SetValue(GetTarget());
}
开发者ID:trinajstica,项目名称:GD,代码行数:17,代码来源:LinkEvent.cpp

示例11: SerializeObjectsTo

void ClassWithObjects::SerializeObjectsTo(SerializerElement & element) const
{
    element.ConsiderAsArrayOf("object");
    for ( std::size_t j = 0;j < initialObjects.size();j++ )
    {
        initialObjects[j]->SerializeTo(element.AddChild("object"));
    }

}
开发者ID:alcemirfernandes,项目名称:GD,代码行数:9,代码来源:ClassWithObjects.cpp

示例12: SerializeTo

void ResourcesManager::SerializeTo(SerializerElement & element) const
{
    SerializerElement & resourcesElement = element.AddChild("resources");
    resourcesElement.ConsiderAsArrayOf("resource");
    for (std::size_t i = 0;i<resources.size();++i)
    {
        if ( resources[i] == std::shared_ptr<Resource>() ) break;

        SerializerElement & resourceElement = resourcesElement.AddChild("resource");
        resourceElement.SetAttribute("kind", resources[i]->GetKind());
        resourceElement.SetAttribute("name", resources[i]->GetName());

        resources[i]->SerializeTo(resourceElement);
    }

    SerializerElement & resourcesFoldersElement = element.AddChild("resourceFolders");
    resourcesFoldersElement.ConsiderAsArrayOf("folder");
    for (std::size_t i = 0;i<folders.size();++i)
        folders[i].SerializeTo(resourcesFoldersElement.AddChild("folder"));
}
开发者ID:alcemirfernandes,项目名称:GD,代码行数:20,代码来源:ResourcesManager.cpp

示例13: SerializeTo

void Object::SerializeTo(SerializerElement & element) const
{
    element.SetAttribute( "name", GetName() );
    element.SetAttribute( "type", GetType() );
    objectVariables.SerializeTo(element.AddChild("variables"));

    SerializerElement & behaviorsElement = element.AddChild("behaviors");
    behaviorsElement.ConsiderAsArrayOf("behavior");
    std::vector < gd::String > allBehaviors = GetAllBehaviorNames();
    for (std::size_t i = 0;i<allBehaviors.size();++i)
    {
        SerializerElement & behaviorElement = behaviorsElement.AddChild("behavior");

        behaviorElement.SetAttribute( "type", GetBehavior(allBehaviors[i]).GetTypeName() );
        behaviorElement.SetAttribute( "name", GetBehavior(allBehaviors[i]).GetName() );
        GetBehavior(allBehaviors[i]).SerializeTo(behaviorElement);
    }

    DoSerializeTo(element);
}
开发者ID:mateerladnam,项目名称:GD,代码行数:20,代码来源:Object.cpp

示例14: SerializeEventsTo

void EventsListSerialization::SerializeEventsTo(const EventsList & list, SerializerElement & events)
{
    events.ConsiderAsArrayOf("event");
    for ( unsigned int j = 0;j < list.size();j++ )
    {
        const gd::BaseEvent & event = list.GetEvent(j);
        SerializerElement & eventElem = events.AddChild("event");

        eventElem.SetAttribute( "disabled", event.IsDisabled());
        eventElem.SetAttribute( "folded", event.folded);
        eventElem.AddChild("type").SetValue(event.GetType());

        event.SerializeTo(eventElem);
    }
}
开发者ID:bran921007,项目名称:GD,代码行数:15,代码来源:Serialization.cpp

示例15: SerializeTo

void EventsFunctionsExtension::SerializeTo(SerializerElement& element) const {
  element.SetAttribute("version", version);
  element.SetAttribute("extensionNamespace", extensionNamespace);
  element.SetAttribute("description", description);
  element.SetAttribute("name", name);
  element.SetAttribute("fullName", fullName);

  gd::SerializerElement& eventsFunctionsElement =
      element.AddChild("eventsFunctions");
  eventsFunctionsElement.ConsiderAsArrayOf("eventsFunction");
  for (const auto& eventsFunction : eventsFunctions) {
    eventsFunction->SerializeTo(
        eventsFunctionsElement.AddChild("eventsFunction"));
  }
}
开发者ID:Lizard-13,项目名称:GD,代码行数:15,代码来源:EventsFunctionsExtension.cpp


注:本文中的SerializerElement::AddChild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。