GDevelop JS Platform
Platform for developing HTML5/Javascript based games with GDevelop
Public Member Functions | Static Public Member Functions | List of all members
gdjs::MetadataDeclarationHelper Class Reference

This file contains the logic to declare extension metadata from events functions or events based behaviors. These are basically adapters from gd::EventsFunctionsExtension, and children, to a real extension declaration (like in JsExtension.js or Extension.cpp files). More...

#include <MetadataDeclarationHelper.h>

Public Member Functions

gd::AbstractFunctionMetadata & GenerateFreeFunctionMetadata (const gd::Project &project, gd::PlatformExtension &extension, const gd::EventsFunctionsExtension &eventsFunctionsExtension, const gd::EventsFunction &eventsFunction)
 

Static Public Member Functions

static gd::BehaviorMetadata & GenerateBehaviorMetadata (const gd::Project &project, gd::PlatformExtension &extension, const gd::EventsFunctionsExtension &eventsFunctionsExtension, const gd::EventsBasedBehavior &eventsBasedBehavior, std::map< gd::String, gd::String > &behaviorMethodMangledNames)
 
static gd::ObjectMetadata & GenerateObjectMetadata (gd::Project &project, gd::PlatformExtension &extension, const gd::EventsFunctionsExtension &eventsFunctionsExtension, const gd::EventsBasedObject &eventsBasedObject, std::map< gd::String, gd::String > &objectMethodMangledNames)
 
static gd::String GetExtensionCodeNamespacePrefix (const gd::EventsFunctionsExtension &eventsFunctionsExtension)
 
static gd::String GetFreeFunctionCodeName (const gd::EventsFunctionsExtension &eventsFunctionsExtension, const gd::EventsFunction &eventsFunction)
 
static gd::String GetFreeFunctionCodeNamespace (const gd::EventsFunction &eventsFunction, const gd::String &codeNamespacePrefix)
 
static gd::String GetBehaviorFunctionCodeNamespace (const gd::EventsBasedBehavior &eventsBasedBehavior, const gd::String &codeNamespacePrefix)
 
static gd::String GetObjectFunctionCodeNamespace (const gd::EventsBasedObject &eventsBasedObject, const gd::String &codeNamespacePrefix)
 
static void DeclareExtension (gd::PlatformExtension &extension, const gd::EventsFunctionsExtension &eventsFunctionsExtension)
 
static bool IsBehaviorLifecycleEventsFunction (const gd::String &functionName)
 
static bool IsObjectLifecycleEventsFunction (const gd::String &functionName)
 
static bool IsExtensionLifecycleEventsFunction (const gd::String &functionName)
 
static gd::String ShiftSentenceParamIndexes (const gd::String &sentence, const int offset)
 

Detailed Description

This file contains the logic to declare extension metadata from events functions or events based behaviors. These are basically adapters from gd::EventsFunctionsExtension, and children, to a real extension declaration (like in JsExtension.js or Extension.cpp files).

Member Function Documentation

◆ DeclareExtension()

void gdjs::MetadataDeclarationHelper::DeclareExtension ( gd::PlatformExtension &  extension,
const gd::EventsFunctionsExtension &  eventsFunctionsExtension 
)
static

Declare an extension from an events based extension.

◆ GetBehaviorFunctionCodeNamespace()

gd::String gdjs::MetadataDeclarationHelper::GetBehaviorFunctionCodeNamespace ( const gd::EventsBasedBehavior &  eventsBasedBehavior,
const gd::String &  codeNamespacePrefix 
)
static

Generate the namespace for a behavior function.

◆ GetExtensionCodeNamespacePrefix()

gd::String gdjs::MetadataDeclarationHelper::GetExtensionCodeNamespacePrefix ( const gd::EventsFunctionsExtension &  eventsFunctionsExtension)
static

Generate the namespace prefix for an extension.

◆ GetFreeFunctionCodeName()

gd::String gdjs::MetadataDeclarationHelper::GetFreeFunctionCodeName ( const gd::EventsFunctionsExtension &  eventsFunctionsExtension,
const gd::EventsFunction &  eventsFunction 
)
static

Generate the fully qualified name for a free function.

◆ GetFreeFunctionCodeNamespace()

gd::String gdjs::MetadataDeclarationHelper::GetFreeFunctionCodeNamespace ( const gd::EventsFunction &  eventsFunction,
const gd::String &  codeNamespacePrefix 
)
static

Generate the namespace for a free function.

◆ GetObjectFunctionCodeNamespace()

gd::String gdjs::MetadataDeclarationHelper::GetObjectFunctionCodeNamespace ( const gd::EventsBasedObject &  eventsBasedObject,
const gd::String &  codeNamespacePrefix 
)
static

Generate the namespace for an object function.

◆ IsBehaviorLifecycleEventsFunction()

bool gdjs::MetadataDeclarationHelper::IsBehaviorLifecycleEventsFunction ( const gd::String &  functionName)
static

Check if the name of the function is the name of a lifecycle function (for events-based behaviors), that will be called automatically by the game engine.

◆ IsExtensionLifecycleEventsFunction()

bool gdjs::MetadataDeclarationHelper::IsExtensionLifecycleEventsFunction ( const gd::String &  functionName)
static

Check if the name of the function is the name of a lifecycle function (for events-based extensions), that will be called automatically by the game engine.

◆ IsObjectLifecycleEventsFunction()

bool gdjs::MetadataDeclarationHelper::IsObjectLifecycleEventsFunction ( const gd::String &  functionName)
static

Check if the name of the function is the name of a lifecycle function (for events-based objects), that will be called automatically by the game engine.


The documentation for this class was generated from the following files: