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


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

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


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

示例1: UnserializeFrom

void LayoutEditorCanvasOptions::UnserializeFrom(const SerializerElement & element)
{
    grid = element.GetBoolAttribute("grid");
    snap = element.GetBoolAttribute("snap");
    windowMask = element.GetBoolAttribute("windowMask");
    gridWidth = element.GetIntAttribute("gridWidth", 32);
    gridHeight = element.GetIntAttribute("gridHeight", 32);
    gridOffsetX = element.GetIntAttribute("gridOffsetX", 0);
    gridOffsetY = element.GetIntAttribute("gridOffsetY", 0);
    gridR = element.GetIntAttribute("gridR", 158);
    gridG = element.GetIntAttribute("gridG", 180);
    gridB = element.GetIntAttribute("gridB", 255);
    zoomFactor = element.GetDoubleAttribute("zoomFactor", 1.0);
    associatedLayout = element.GetStringAttribute("associatedLayout");
}
开发者ID:heyuqi,项目名称:GD,代码行数:15,代码来源:LayoutEditorCanvasOptions.cpp

示例2: UnserializeFrom

void GroupEvent::UnserializeFrom(gd::Project & project, const SerializerElement & element)
{
    name = element.GetStringAttribute("name");
    source = element.GetStringAttribute("source");
    creationTime = element.GetIntAttribute("creationTime");
    colorR = element.GetIntAttribute("colorR");
    colorG = element.GetIntAttribute("colorG");
    colorB = element.GetIntAttribute("colorB");
    gd::EventsListSerialization::UnserializeEventsFrom(project, events, element.GetChild("events"));

    parameters.clear();
    gd::SerializerElement & parametersElement = element.GetChild("parameters");
    parametersElement.ConsiderAsArrayOf("parameters");
    for ( std::size_t i = 0;i < parametersElement.GetChildrenCount();++i)
        parameters.push_back(parametersElement.GetChild(i).GetValue().GetString());
}
开发者ID:alcemirfernandes,项目名称:GD,代码行数:16,代码来源:GroupEvent.cpp

示例3: UnserializeFrom

void ExternalEvents::UnserializeFrom(gd::Project & project, const SerializerElement & element)
{
    name = element.GetStringAttribute("name", "", "Name");
    associatedScene = element.GetStringAttribute("associatedLayout", "", "AssociatedScene");
    lastChangeTimeStamp = element.GetIntAttribute("lastChangeTimeStamp", 0, "LastChangeTimeStamp");
    gd::EventsListSerialization::UnserializeEventsFrom(project, events, element.GetChild("events", 0, "Events"));
}
开发者ID:HaoDrang,项目名称:GD,代码行数:7,代码来源:ExternalEvents.cpp

示例4: UnserializeFrom

void Layout::UnserializeFrom(gd::Project & project, const SerializerElement & element)
{
    SetBackgroundColor(element.GetIntAttribute( "r" ), element.GetIntAttribute( "v" ), element.GetIntAttribute( "b" ));
    SetWindowDefaultTitle( element.GetStringAttribute("title", "(No title)", "titre") );
    oglFOV = element.GetDoubleAttribute("oglFOV");
    oglZNear = element.GetDoubleAttribute("oglZNear");
    oglZFar = element.GetDoubleAttribute("oglZFar");
    standardSortMethod = element.GetBoolAttribute( "standardSortMethod" );
    stopSoundsOnStartup = element.GetBoolAttribute( "stopSoundsOnStartup" );
    disableInputWhenNotFocused = element.GetBoolAttribute( "disableInputWhenNotFocused" );

    #if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
    associatedSettings.UnserializeFrom(element.GetChild("uiSettings", 0, "UISettings"));
    #endif

    #if defined(GD_IDE_ONLY)
    gd::ObjectGroup::UnserializeFrom(objectGroups, element.GetChild( "objectsGroups", 0, "GroupesObjets" ));
    gd::EventsListSerialization::UnserializeEventsFrom(project, GetEvents(), element.GetChild("events", 0, "Events"));
    #endif

    UnserializeObjectsFrom(project, element.GetChild("objects", 0, "Objets"));
    initialInstances.UnserializeFrom(element.GetChild("instances", 0, "Positions"));
    variables.UnserializeFrom(element.GetChild("variables", 0, "Variables"));

    initialLayers.clear();
    SerializerElement & layersElement = element.GetChild("layers", 0, "Layers");
    layersElement.ConsiderAsArrayOf("layer", "Layer");
    for (std::size_t i = 0; i < layersElement.GetChildrenCount(); ++i)
    {
        gd::Layer layer;

        layer.UnserializeFrom(layersElement.GetChild(i));
        initialLayers.push_back(layer);
    }

    //Compatibility with GD <= 4
    gd::String deprecatedTag1 = "automatismsSharedData";
    gd::String deprecatedTag2 = "automatismSharedData";
    if (!element.HasChild(deprecatedTag1))
    {
        deprecatedTag1 = "AutomatismsSharedDatas";
        deprecatedTag2 = "AutomatismSharedDatas";
    }
    //end of compatibility code

    SerializerElement & behaviorsDataElement = element.GetChild("behaviorsSharedData", 0, deprecatedTag1);
    behaviorsDataElement.ConsiderAsArrayOf("behaviorSharedData", deprecatedTag2);
    for (unsigned int i = 0; i < behaviorsDataElement.GetChildrenCount(); ++i)
    {
        SerializerElement & behaviorDataElement = behaviorsDataElement.GetChild(i);
        gd::String type = behaviorDataElement.GetStringAttribute("type", "", "Type")
            .FindAndReplace("Automatism", "Behavior"); //Compatibility with GD <= 4

        std::shared_ptr<gd::BehaviorsSharedData> sharedData = project.CreateBehaviorSharedDatas(type);
        if ( sharedData != std::shared_ptr<gd::BehaviorsSharedData>() )
        {
            sharedData->SetName( behaviorDataElement.GetStringAttribute("name", "", "Name") );
            sharedData->UnserializeFrom(behaviorDataElement);

            behaviorsInitialSharedDatas[sharedData->GetName()] = sharedData;
        }

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


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