本文整理汇总了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;
}
示例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;
}
示例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;
}