GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
Public Member Functions | List of all members

Base class for implementing a platform. More...

#include <Platform.h>

Public Member Functions

virtual gd::String GetName () const
 Must return the platform name.
 
virtual gd::String GetFullName () const
 Must return the platform full name, displayed to users.
 
virtual gd::String GetSubtitle () const
 Must return a text describing the platform in a few words.
 
virtual gd::String GetDescription () const
 Must return a text describing the platform, displayed to users.
 
virtual gd::String GetIcon () const
 Must return a filename to a 32*32 image file for the platform.
 
void EnableExtensionLoadingLogs (bool enable)
 Activate or disable the logs on the standard output when loading an extension.
 
Extensions management

Member functions used to manage the extensions

virtual void ReloadBuiltinExtensions ()
 (Re)load platform built-in extensions. More...
 
virtual gd::String GetExtensionCreateFunctionName ()
 Must return the name of the function that is used to create an extension for this platform. More...
 
virtual bool AddExtension (std::shared_ptr< PlatformExtension > extension)
 Add an extension to the platform. More...
 
bool IsExtensionLoaded (const gd::String &name) const
 Return true if an extension with the specified name is loaded.
 
std::shared_ptr< PlatformExtensionGetExtension (const gd::String &name) const
 Get an extension of the platform. More...
 
const std::vector< std::shared_ptr< gd::PlatformExtension > > & GetAllPlatformExtensions () const
 Get all extensions loaded for the platform. More...
 
virtual void RemoveExtension (const gd::String &name)
 Remove an extension from the platform. More...
 
const InstructionOrExpressionGroupMetadataGetInstructionOrExpressionGroupMetadata (const gd::String &name) const
 Get the metadata (icon, etc...) of a group used for instructions or expressions.
 
Factory method

Member functions used to create the platform objects. TODO: This could be moved to gd::MetadataProvider.

std::unique_ptr< gd::ObjectConfigurationCreateObjectConfiguration (gd::String type) const
 Create an object of given type with the specified name.
 
std::shared_ptr< gd::BaseEventCreateEvent (const gd::String &type) const
 Create an event of given type.
 

Detailed Description

Base class for implementing a platform.

Member Function Documentation

◆ AddExtension()

bool gd::Platform::AddExtension ( std::shared_ptr< PlatformExtension extension)
virtual

Add an extension to the platform.

Note
This method is virtual and can be redefined by platforms if they want to do special work when an extension is loaded.
See also
gd::ExtensionsLoader

◆ GetAllPlatformExtensions()

const std::vector<std::shared_ptr<gd::PlatformExtension> >& gd::Platform::GetAllPlatformExtensions ( ) const
inline

Get all extensions loaded for the platform.

Returns
Vector of Shared pointer containing all extensions

◆ GetExtension()

std::shared_ptr< gd::PlatformExtension > gd::Platform::GetExtension ( const gd::String name) const

Get an extension of the platform.

Returns
Shared pointer to the extension

◆ GetExtensionCreateFunctionName()

virtual gd::String gd::Platform::GetExtensionCreateFunctionName ( )
inlinevirtual

Must return the name of the function that is used to create an extension for this platform.

For example, GD C++ Platform uses "CreateGDExtension" and GD JS Platform "CreateGDJSExtension".

See also
gd::ExtensionsLoader

◆ ReloadBuiltinExtensions()

virtual void gd::Platform::ReloadBuiltinExtensions ( )
inlinevirtual

(Re)load platform built-in extensions.

Note
Can be useful if, for example, the user changed the language of the editor.

◆ RemoveExtension()

void gd::Platform::RemoveExtension ( const gd::String name)
virtual

Remove an extension from the platform.

Events, objects, behaviors provided by the extension won't be available anymore.


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