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


C++ Layout::GetEvents方法代码示例

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


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

示例1: GenerateSceneEventsCompleteCode

gd::String EventsCodeGenerator::GenerateSceneEventsCompleteCode(gd::Project & project, gd::Layout & scene, gd::EventsList & events, bool compilationForRuntime)
{
    gd::String output;

    //Prepare the global context ( Used to get needed header files )
    gd::EventsCodeGenerationContext context;
    EventsCodeGenerator codeGenerator(project, scene);
    codeGenerator.PreprocessEventList(scene.GetEvents());
    codeGenerator.SetGenerateCodeForRuntime(compilationForRuntime);

    //Generate whole events code
    gd::String wholeEventsCode = codeGenerator.GenerateEventsListCode(events, context);

    //Generate default code around events:
    //Includes
    output += "#include <vector>\n#include <map>\n#include <string>\n#include <algorithm>\n#include <SFML/System/Clock.hpp>\n#include <SFML/System/Vector2.hpp>\n#include <SFML/Graphics/Color.hpp>\n#include \"GDCpp/RuntimeContext.h\"\n#include \"GDCpp/RuntimeObject.h\"\n";
    for ( set<gd::String>::iterator include = codeGenerator.GetIncludeFiles().begin() ; include != codeGenerator.GetIncludeFiles().end(); ++include )
        output += "#include \""+*include+"\"\n";

    //Extra declarations needed by events
    for ( set<gd::String>::iterator declaration = codeGenerator.GetCustomGlobalDeclaration().begin() ; declaration != codeGenerator.GetCustomGlobalDeclaration().end(); ++declaration )
        output += *declaration+"\n";

    output +=
    codeGenerator.GetCustomCodeOutsideMain()+
    "\n"
    "extern \"C\" int GDSceneEvents"+gd::SceneNameMangler::GetMangledSceneName(scene.GetName())+"(RuntimeContext * runtimeContext)\n"
    "{\n"+
    "runtimeContext->StartNewFrame();\n"+
    codeGenerator.GetCustomCodeInMain()+
    wholeEventsCode+
    "return 0;\n"
    "}\n";

    return output;
}
开发者ID:mateerladnam,项目名称:GD,代码行数:36,代码来源:EventsCodeGenerator.cpp

示例2: FindArgumentsInEvents

std::set < std::string > EventsVariablesFinder::FindAllObjectVariables(const gd::Platform & platform, const gd::Project & project, const gd::Layout & layout, const gd::Object & object)
{
    std::set < std::string > results;

    std::set < std::string > results2 = FindArgumentsInEvents(platform, project, layout, layout.GetEvents(), "objectvar", object.GetName());
    results.insert(results2.begin(), results2.end());

    return results;
}
开发者ID:cubemoon,项目名称:GD,代码行数:9,代码来源:EventsVariablesFinder.cpp

示例3: FindArgumentsInEvents

std::set < gd::String > EventsVariablesFinder::FindAllLayoutVariables(const gd::Platform & platform, const gd::Project & project, const gd::Layout & layout)
{
    std::set < gd::String > results;

    std::set < gd::String > results2 = FindArgumentsInEvents(platform, project, layout, layout.GetEvents(), "scenevar");
    results.insert(results2.begin(), results2.end());

    return results;
}
开发者ID:HaoDrang,项目名称:GD,代码行数:9,代码来源:EventsVariablesFinder.cpp


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